X Tutup
Skip to content

Superimposed markers when scatterpoints=1 #8569

@silvioricardoc

Description

@silvioricardoc

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 not

Expected 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup