pyplot: marker size scales correctly

This commit is contained in:
Zhanibek 2020-04-24 11:35:40 +09:00
parent 583042baf5
commit d8308f0ba2

View File

@ -1320,10 +1320,10 @@ function py_add_legend(plt::Plot, sp::Subplot, ax)
linewidth = py_thickness_scale(plt, clamp(get_linewidth(series), 0, 5)), linewidth = py_thickness_scale(plt, clamp(get_linewidth(series), 0, 5)),
linestyle = py_linestyle(:path, get_linestyle(series)), linestyle = py_linestyle(:path, get_linestyle(series)),
marker = py_marker(_cycle(series[:markershape], 1)), marker = py_marker(_cycle(series[:markershape], 1)),
markersize = py_thickness_scale(plt, 6), # 6 looks same the default, do not put ^2 markersize = py_thickness_scale(plt, sp[:legendfontsize]),
markeredgecolor = py_color(single_color(get_markerstrokecolor(series)), get_markerstrokealpha(series)), markeredgecolor = py_color(single_color(get_markerstrokecolor(series)), get_markerstrokealpha(series)),
markerfacecolor = py_color(single_color(get_markercolor(series, clims)), get_markeralpha(series)), markerfacecolor = py_color(single_color(get_markercolor(series, clims)), get_markeralpha(series)),
markeredgewidth = py_thickness_scale(plt, series[:markerstrokewidth] * 6 / series[:markersize]) # retain the markersize/markerstroke ratio from the markers on the plot markeredgewidth = py_thickness_scale(plt, series[:markerstrokewidth] * sp[:legendfontsize] / series[:markersize]) # retain the markersize/markerstroke ratio from the markers on the plot
) )
else else
series[:serieshandle][1] series[:serieshandle][1]