I use subplot2grid
to make a subplot like the following:
In order to make the ticks sufficiently large for publication, I need to increase the vertical and horizontal spacing between axes.
Normally, I would use something like subplot_adjust(hspace = 0.5)
, but that doesn't seem to work with subplot2grid
.
Could anyone please recommend a solution?
Here is the code I use to plot things and create the axes:
import matplotlib.pyplot as plt
ax1 = plt.subplot2grid((2,2),(0,0), colspan = 2)
ax2 = plt.subplot2grid((2,2),(1,0), colspan = 1)
ax3 = plt.subplot2grid((2,2),(1,1), colspan = 1)
df.plot( ax = ax1)
plt.show()
I've found the solution here
The code is as follows:
AX = gridspec.GridSpec(2,2)
AX.update(wspace = 0.5, hspace = 0.5)
ax1 = plt.subplot(AX[0,:])
ax2 = plt.subplot(AX[1,0])
ax3 = plt.subplot(AX[1,1])
Which produces the same subplots with increased horizontal and vertical spacing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With