-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Closed
Description
Bug report
Bug summary
Savefig does not generate legends with a single marker when scatterpoints=1 and the output file format is PDF/EPS/SVG. (A similar problem also happens when scatterpoints=2).
Code for reproduction
from matplotlib import pyplot as plt
plt.scatter([1,2,3], [2,4,7], [10,20,70], facecolor="none", edgecolor="y", label="Foobar")
plt.legend(scatterpoints=1)
plt.savefig("output.png") # this works perfectly
plt.savefig("output.pdf") # this does not
plt.savefig("output.eps") # this does not
plt.savefig("output.svg") # this does notExpected outcome
The output images should all be be similar, with a legend that only shows a single marker (since scatterpoints=1).
Actual outcome
The output PNG file looks perfect, just like with plt.show(). The PDF/EPS/SVG files have 3 superimposed markers inside the legend.
Matplotlib version
- Operating System: Ubuntu 16.04
- Matplotlib Version: 1.5.1
- Python Version: 3.5.2
- Jupyter Version (if applicable): None.
- Other Libraries: None.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels