Plots.jl: Adding markers to the legend with pyplot

Created on 8 Jun 2017  路  9Comments  路  Source: JuliaPlots/Plots.jl

As discussed at https://stackoverflow.com/questions/44401976/how-do-you-add-markers-to-the-legend-of-a-plots-jl-plot/44405883#44405883, for a line/scatter plot with marker = true, there is no way to display both the marker and the line together in the legend. This would be a nice feature to add.

Hacktoberfest PyPlot bug

Most helpful comment

Thanks @daschw , it is always a pleasure to work with the people at Plots.jl :smiley:

All 9 comments

I wouldn't really call this a feature but a bug :)

It should be fairly straightforward to implement, if you'd like to make a PR? It needs to be done on a backend-by-backend basis, though.

@mkborregaard Sorry, are you talking to me or to cortner? I have no idea how the Plots package's internals work, and don't know how to implement this feature ...

To @cortner who I believe could definitely do it. It is also fine to wait - we will get to it eventually.

Not sure how I've deserved your optimism. I briefly looked at the pyplot backend - not all that straightforward for somebody who has worked on neither Plots.jl nor PyPlot. One would probably need to combine the if series[:markershape] != :none block with the if series[:linewidth] > 0 block.

If I find the time (and care enough) I will have a go.

I've update to reflect that this is only a problem on pyplot - on GR and plotlyjs it works:

plot(rand(10,4), markershape = :auto)

skaermbillede 2017-10-03 kl 08 23 34

Should we close this issue? Or do we wait until the next tag?

Closing with #1133
Thanks @JackDevine!

Thanks @daschw , it is always a pleasure to work with the people at Plots.jl :smiley:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dancsi picture dancsi  路  4Comments

tbenst picture tbenst  路  3Comments

lstagner picture lstagner  路  5Comments

cortner picture cortner  路  4Comments

crstnbr picture crstnbr  路  3Comments