I have used the answers to this question to generate the two polar contour plots that appear side by side. I can extend the grid to a 2 by 2 grid of polar contour plots by simply editing the answer to the above post such that you track the grid positions:
fig, axs = plt.subplots(2, 2, figsize=(12,5),subplot_kw=dict(projection='polar'))
p1 = axs[0,0].contourf(theta, r, Z1, 100)
p2 = axs[0,1].contourf(theta, r, Z2, 100)
p3 = axs[1,0].contourf(theta, r, Z2, 100)
p4 = axs[1,1].contourf(theta, r, Z2, 100)
This generates the following image:
The spacing between each subplot is clearly an issue. How can I edit the spacing both in the horizontal and vertical directions and scale each polar plot to make them slightly larger?
MWE
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
import matplotlib.colors as colors
from matplotlib import gridspec#, ticker
X = np.arange(0, 70, 10)
Y = np.radians(np.linspace(0, 360, 20))
r, theta = np.meshgrid(X,Y)
Z1 = np.random.random((azimuths.size, zeniths.size))
Z2 = np.random.random((azimuths.size, zeniths.size))
Z3 = np.random.random((azimuths.size, zeniths.size))
Z4 = np.random.random((azimuths.size, zeniths.size))
fig, axs = plt.subplots(2, 2, figsize=(12,5),subplot_kw=dict(projection='polar'))
p1 = axs[0,0].contourf(theta, r, Z1, 100)
p2 = axs[0,1].contourf(theta, r, Z2, 100)
p3 = axs[1,0].contourf(theta, r, Z2, 100)
p4 = axs[1,1].contourf(theta, r, Z2, 100)
#-- obtaining the colormap limits
vmin,vmax = p2.get_clim()
#-- Defining a normalised scale
cNorm = mpl.colors.Normalize(vmin=vmin, vmax=vmax)
#-- Creating a new axes at the right side
ax3 = fig.add_axes([0.9, 0.1, 0.03, 0.8])
#-- Plotting the colormap in the created axes
cb1 = mpl.colorbar.ColorbarBase(ax3, norm=cNorm)
fig.subplots_adjust(left=0.05,right=0.85)
plt.show()
In the above MWE, I just added some example data that resembles closely the post in this questions.