Ok, this is my first question asking a question here, so please be patient with me; -)
I am trying to create a series of subheadings (with two y-axes each) on a figure using matplotlib and then save that figure. I use GridSpec to create a grid for the subtitles and realized that they overlap a bit, which I don't want. So I'm trying to use tight_layout () to figure it out, which, according to the matplotlib documentation, should work fine. To simplify some things, my code looks something like this:
import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec fig = plt.figure(num=None, facecolor='w', edgecolor='k') grid = gridspec.GridSpec(2, numRows)
After the data processing cycle is completed and I have created all the subheadings, I end up with
fig.tight_layout() fig.savefig(str(location))
As far as I can do this, this should work, however, when you call tight_layout (), I get a ValueError from the self.subplotpars: left function cannot be> = right. My question is: how to find out what causes this error and how to fix it?
python matplotlib
ally
source share