Closed as not planned
Description
Bug summary
After figure is saved using PdfPages matplot lib shows error when trying to use figure.show(0:
"AttributeError: Figure.show works only for figures managed by pyplot, normally created by pyplot.figure()"
This is new as it worked fine in matplotlib 3.6.3
Code for reproduction
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
r_fig = plt.figure('Results', layout='tight')
r_fig.set_size_inches(8,6)
r_ax1 = plt.subplot(221)
r_ax2 = plt.subplot(222)
r_ax1.plot([1,2,3],[1,2,3])
r_ax2.plot([1,2,3],[2,4,6])
pdff = PdfPages("C:\\Data\\Python\\r_file.pdf")
pdff.savefig(r_fig)
pdff.close()
r_fig.show()
Actual outcome
AttributeError: Figure.show works only for figures managed by pyplot, normally created by pyplot.figure()
Expected outcome
figure shown
Additional information
No response
Operating system
Windows 11
Matplotlib Version
3.8.3
Matplotlib Backend
TkAgg
Python version
3.11.8
Jupyter version
No response
Installation
pip
Metadata
Metadata
Assignees
Labels
No labels