Closed
Description
Bug report
Bug summary
matplotlib version 2.1.0 generates pdf files that are a lot larger than those generated by version 2.0.2. In one case a file that looks exactly the same went from 635KB to 127MB. A simpler code sample is presented below in which the size grew from 11KB to 20KB.
Is there a way to get the size of version 2.0.2?
Code for reproduction
import matplotlib as mlp
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from sklearn.datasets import load_iris
print(mlp.__version__)
iris = load_iris()
data = iris.data
plt.scatter(data[:,0], data[:,1])
plt.xlabel('x values')
plt.ylabel('y values')
plt.title('example')
pdf = PdfPages(r"test.pdf")
plt.savefig(pdf, format='pdf', bbox_inches = 'tight')
plt.show()
pdf.close()
pdf = None
Matplotlib version
- Operating system:
- Matplotlib version: 2.1.0
- Matplotlib backend (
print(matplotlib.get_backend())
): - Python version:
- Jupyter version (if applicable):
- Other libraries:
conda
anaconda
Edit (@afvincent): cosmetic edit, mainly to get syntax highlighting.