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
Great Britain
India
Germany
France
Canada
Russia
Spain
Brazil
Australia
Singapore
Hungary
Ukraine
Luxembourg
Estonia
Lithuania
South Korea
Turkey
Switzerland
Colombia
Taiwan
Chile
Norway
Ecuador
Indonesia
New Zealand
Cyprus
Denmark
Finland
Poland
Malta
Czechia
Austria
Sweden
Italy
Egypt
Belgium
Portugal
Slovenia
Ireland
Romania
Greece
Argentina
Netherlands
Bulgaria
Latvia
South Africa
Malaysia
Japan
Slovakia
Philippines
Mexico
Thailand