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