Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scatter Classes Legend Fill #120

Open
bjack205 opened this issue Jul 13, 2019 · 1 comment
Open

Scatter Classes Legend Fill #120

bjack205 opened this issue Jul 13, 2019 · 1 comment

Comments

@bjack205
Copy link

I'm having an issue with the scatter classes field. Here's the example from the documentation:

x = 1:10
y = 2x
z = ["a", "a", "a", "b", "b", "b", "b", "c", "c", "c"]
sc = "{a={mark=square,orange},b={mark=triangle,red},c={mark=o,black}}"
Plots.Scatter(x, y, z, scatterClasses=sc, legendentry=["A", "B", "C"])

This plots just fine; however, if the markers are filled in then the legend markers are filled in blue:

z = ["a", "a", "a", "b", "b", "b", "b", "c", "c", "c"]
sc = "{a={mark=square*,blue},b={mark=triangle*,red},c={mark=o*,black}}"
Plots.Scatter(x, y, z, scatterClasses=sc, legendentry=["A", "B", "C"])

Screenshot from 2019-07-12 18-38-02

I'm very new to PGFPlots, but I did find that changing the \addplot+[...] to \addplot[...] (avoiding \addplot+ per the documentation) fixes the issue. Not sure if that's an easy fix in PGFPlots.jl, though.

Thanks!

@mykelk
Copy link
Member

mykelk commented Jul 13, 2019

Thank you for filing this issue. I think you can just change the addplot+ commands in the function plotHelper(o::IO, p::Scatter) in src/PGFPlots.jl. If that does the trick for you, please file a PR and let's get it merged in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants