get_topmost_subplotspec error while customizing plot

Hello, I'm trying to change the appearance of a multiplot created with yt for publication. I'm using the example https://yt-project.org/docs/dev/cookbook/complex_plots.html?highlight=panel%... and I just added two lines at the beginning. These are : import os import matplotlib.pyplot as plt dirFile='/fs/posgrado04/other0/guido/python_tools/plot_styles' plt.style.use(os.path.join(dirFile,'paper_fig.mplstyle')) The content of the style file is the following: xtick.labelsize:16 ytick.labelsize:16 font.size:15 figure.autolayout: True figure.figsize: 7.2,4.45 axes.titlesize : 16 axes.labelsize : 17 lines.linewidth : 2 lines.markersize : 6 legend.fontsize: 13 mathtext.fontset: stix font.family: STIXGeneral After running the code, I get the following error:: Traceback (most recent call last): File "multiplot_2x2_time_series.py", line 54, in <module> plt.savefig("multiplot_2x2_time_series_style.png") File "/fs/posgrado04/other0/guido/yt-conda/lib/python3.8/site-packages/matplotlib/pyplot.py", line 859, in savefig res = fig.savefig(*args, **kwargs) File "/fs/posgrado04/other0/guido/yt-conda/lib/python3.8/site-packages/matplotlib/figure.py", line 2311, in savefig self.canvas.print_figure(fname, **kwargs) File "/fs/posgrado04/other0/guido/yt-conda/lib/python3.8/site-packages/matplotlib/backend_bases.py", line 2210, in print_figure result = print_method( File "/fs/posgrado04/other0/guido/yt-conda/lib/python3.8/site-packages/matplotlib/backend_bases.py", line 1639, in wrapper return func(*args, **kwargs) File "/fs/posgrado04/other0/guido/yt-conda/lib/python3.8/site-packages/matplotlib/backends/backend_agg.py", line 509, in print_png FigureCanvasAgg.draw(self) File "/fs/posgrado04/other0/guido/yt-conda/lib/python3.8/site-packages/matplotlib/backends/backend_agg.py", line 407, in draw self.figure.draw(self.renderer) File "/fs/posgrado04/other0/guido/yt-conda/lib/python3.8/site-packages/matplotlib/artist.py", line 41, in draw_wrapper return draw(artist, renderer, *args, **kwargs) File "/fs/posgrado04/other0/guido/yt-conda/lib/python3.8/site-packages/matplotlib/figure.py", line 1857, in draw self.tight_layout(**self._tight_parameters) File "/fs/posgrado04/other0/guido/yt-conda/lib/python3.8/site-packages/matplotlib/cbook/deprecation.py", line 411, in wrapper return func(*inner_args, **inner_kwargs) File "/fs/posgrado04/other0/guido/yt-conda/lib/python3.8/site-packages/matplotlib/figure.py", line 2601, in tight_layout subplotspec_list = get_subplotspec_list(self.axes) File "/fs/posgrado04/other0/guido/yt-conda/lib/python3.8/site-packages/matplotlib/tight_layout.py", line 197, in get_subplotspec_list subplotspec = subplotspec.get_topmost_subplotspec() AttributeError: 'NoneType' object has no attribute 'get_topmost_subplotspec' This kind of error only appears when using AxisGrid, have you seen sth similar ? Regards,
participants (1)
-
Guido Granda Muñoz