0

There is something that I have been trying to do with not success. I have a series of 6 polar graphs in 2 rows X 3 columns and I am trying to add subtitles to the two columns. I have been trying to use create_subtitle option from matplotlib but it gives me the following error:

"name 'create_subtitle' is not defined"

How could I achieve this?

Weirdly I have used this function before in other python code with subplot and it worked but now python complains about. Cheers, Lazaro

import matplotlib.pyplot as plt 
from matplotlib.gridspec import SubplotSpec

rows = 2
cols = 3
fig, axn = plt.subplots(rows, cols, sharey=False, sharex=False, subplot_kw=dict(projection="polar"),
figsize=(20,14))
grid = plt.GridSpec(rows, cols)
create_subtitle(fig, grid[0, ::], 'SUBTITLE 1')
create_subtitle(fig, grid[1, ::], 'SUBTITLE 2')
plt.show()

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
Laz
  • 45
  • 2
  • `axn = axn.flat` , `axn[0].set_title('Title of Subplot 0')` and `fig.suptitle('Main Figure Title')` [code and plot](https://i.stack.imgur.com/UzIzO.png) – Trenton McKinney May 12 '23 at 17:31

0 Answers0