change legend symbols for shapes and filled plots on pyplot

This commit is contained in:
Daniel Schwabeneder 2017-11-17 11:33:10 +01:00
parent 18619e9010
commit 1aa780f0a2

View File

@ -1221,10 +1221,11 @@ function py_add_legend(plt::Plot, sp::Subplot, ax)
for series in series_list(sp)
if should_add_to_legend(series)
# add a line/marker and a label
push!(handles, if series[:seriestype] == :shape
PyPlot.plt[:Line2D]((0,1),(0,0),
color = py_color(_cycle(series[:fillcolor],1)),
linewidth = py_dpi_scale(plt, 4)
push!(handles, if series[:seriestype] == :shape || series[:fillrange] != nothing
pypatches[:Patch](
edgecolor = py_color(_cycle(series[:linecolor],1)),
facecolor = py_color(_cycle(series[:fillcolor],1)),
linewidth = py_dpi_scale(plt, series[:linewidth])
)
elseif series[:seriestype] == :path
PyPlot.plt[:Line2D]((0,1),(0,0),