Closed
Description
Bug report
Bug summary
The animated artists are missing when saving a figure with the pdf backend (matplotlib 3.0.0 and more recent). The png backend is working fine.
Code for reproduction
# Paste your code here
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 2 * np.pi, 100)
fig, ax = plt.subplots()
(ln,) = ax.plot(x, np.sin(x), animated=True)
plt.show(block=False)
plt.pause(0.1)
bg = fig.canvas.copy_from_bbox(fig.bbox)
ax.draw_artist(ln)
fig.canvas.blit(fig.bbox)
plt.savefig('Trial.pdf')
Actual outcome
Saving using the following works fine:
# This is working fine
from matplotlib.backends.backend_pdf import PdfPages
with PdfPages('Trial.pdf') as pdf:
pdf.savefig()
Matplotlib version
- Operating system: linux
- Matplotlib version: 3.0.0 and above
- Matplotlib backend (
print(matplotlib.get_backend())
): 'Qt5Agg' - Python version: 3.7.7
- Jupyter version (if applicable):
- Other libraries:
Metadata
Metadata
Assignees
Labels
No labels