GridSpec() is another powerful feature for complex figure layouts. plt.subplot() and plt.subplot2grid() add plots one at a time after instantiating the figure, and figure layout is specified in the number of rows and columns in each subplot, followed by the sequence number of the plot from left to right and top to bottom. But plt.subplots() defines the entire figure layout, in terms of number of rows and columns, in one go, then each plot/axes is accessed using the corresponding index. GridSpec() enables multiple grids to be created in the figure layout, with each grid similar to plt.subplots(). In this recipe, we will learn about how to use GridSpec() and how GridSpec() keyword parameters can be used with plt.subplots().
United States
United Kingdom
India
Germany
France
Canada
Russia
Spain
Brazil
Australia
Argentina
Austria
Belgium
Bulgaria
Chile
Colombia
Cyprus
Czechia
Denmark
Ecuador
Egypt
Estonia
Finland
Greece
Hungary
Indonesia
Ireland
Italy
Japan
Latvia
Lithuania
Luxembourg
Malaysia
Malta
Mexico
Netherlands
New Zealand
Norway
Philippines
Poland
Portugal
Romania
Singapore
Slovakia
Slovenia
South Africa
South Korea
Sweden
Switzerland
Taiwan
Thailand
Turkey
Ukraine