adjust pyplot to master
This commit is contained in:
parent
49d5489e96
commit
01253b97fb
@ -1607,20 +1607,10 @@ function py_add_legend(plt::Plot, sp::Subplot, ax)
|
||||
linestyle = py_linestyle(series[:seriestype], ls),
|
||||
capstyle = "butt",
|
||||
)
|
||||
elseif series[:seriestype] in (:path, :straightline, :scatter, :steppre, :stepmid, :steppost)
|
||||
hasline = get_linewidth(series) > 0
|
||||
PyPlot.plt."Line2D"((0, 1),(0,0),
|
||||
color = py_color(single_color(get_linecolor(series, clims)), get_linealpha(series)),
|
||||
linewidth = py_thickness_scale(plt, hasline * sp[:legend_font_pointsize] / 8),
|
||||
linestyle = py_linestyle(:path, get_linestyle(series)),
|
||||
solid_capstyle = "butt", solid_joinstyle = "miter",
|
||||
dash_capstyle = "butt", dash_joinstyle = "miter",
|
||||
marker = py_marker(_cycle(series[:markershape], 1)),
|
||||
markersize = py_thickness_scale(plt, 0.8 * sp[:legend_font_pointsize]),
|
||||
markeredgecolor = py_color(single_color(get_markerstrokecolor(series)), get_markerstrokealpha(series)),
|
||||
markerfacecolor = py_color(single_color(get_markercolor(series, clims)), get_markeralpha(series)),
|
||||
markeredgewidth = py_thickness_scale(plt, 0.8 * get_markerstrokewidth(series) * sp[:legend_font_pointsize] / first(series[:markersize])) # retain the markersize/markerstroke ratio from the markers on the plot
|
||||
)
|
||||
|
||||
# plot two handles on top of each other by passing in a tuple
|
||||
# https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html
|
||||
push!(handles, (line_handle, fill_handle))
|
||||
else
|
||||
# plot line handle (which includes solid fill) only
|
||||
push!(handles, line_handle)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user