JuliaPy / PyPlot.jl

Plotting for Julia based on matplotlib.pyplot
https://github.com/JuliaPy/PyPlot.jl
MIT License
475 stars 87 forks source link

wrong legend symbols when using handles and labels from get_legend_handles_labels #401

Open stakaz opened 5 years ago

stakaz commented 5 years ago

Hello, when I try to use get_legend_handles_labels and use these handles and labels in the legend, I get wrong results for errobar plots with actual errors.

this works fine:

errorbar([1],[2],label = "no error")
errorbar([2],[2],[3],label = "with error")
legend()

image

while this one produces a wrong result:

errorbar([1],[2],label = "no error")
errorbar([2],[2],[3],label = "with error")
h, l = gca()[:get_legend_handles_labels]()
legend(h,l)

image

I cannot tell you where the problem lies but I hope this can be fixed or there is a workaround... Thanks.