I have a 3x2 grid of equal sized plots. I use the command
plt.suptitle("Awesome title") # (1)
to have a centered title above the 6 plots. I use the command
plt.title("Almost awesome title") # (2)
for a specific title above each subplot. Now the tricky part: I want a centered title between first and second row of subplots. After manipulating the position parameter of (2) to something like (1.1 , 1.0), I can not seem to get a properly/nicely formatted figure.
TL;DR: I want an additional plt.suptitle("Title")
that be put as shown on picture below: (photoshopped)
Just make some extra room between rows, and add text:
fig, axs = plt.subplots(2, 2)
plt.sca(axs[0,0])
plt.title('Sigmoid')
plt.sca(axs[0,1])
plt.title('ReLU')
plt.suptitle('Activation functions')
# Adjust vertical_spacing = 0.5 * axes_height
plt.subplots_adjust(hspace=0.5)
# Add text in figure coordinates
plt.figtext(0.5, 0.5, 'Effect of bias addition', ha='center', va='center')
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