line caps, legendbox (#2802)

This commit is contained in:
isentropic 2020-06-24 14:34:02 +09:00 committed by GitHub
parent 47590b2538
commit 07146e84e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -444,7 +444,8 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
color = py_color(single_color(get_linecolor(series, clims, i)), get_linealpha(series, i)),
linewidth = py_thickness_scale(plt, get_linewidth(series, i)),
linestyle = py_linestyle(st, get_linestyle(series, i)),
solid_capstyle = "round",
solid_capstyle = "butt",
dash_capstyle = "butt",
drawstyle = py_stepstyle(st)
)[1]
push!(handles, handle)
@ -1360,7 +1361,8 @@ function py_add_legend(plt::Plot, sp::Subplot, ax)
edgecolor = py_color(single_color(get_linecolor(series, clims)), get_linealpha(series)),
facecolor = py_color(single_color(get_fillcolor(series, clims)), get_fillalpha(series)),
linewidth = py_thickness_scale(plt, clamp(get_linewidth(series), 0, 5)),
linestyle = py_linestyle(series[:seriestype], get_linestyle(series))
linestyle = py_linestyle(series[:seriestype], get_linestyle(series)),
capstyle = "butt"
)
elseif series[:seriestype] in (:path, :straightline, :scatter, :steppre, :steppost)
hasline = get_linewidth(series) > 0
@ -1368,6 +1370,8 @@ function py_add_legend(plt::Plot, sp::Subplot, ax)
color = py_color(single_color(get_linecolor(series, clims)), get_linealpha(series)),
linewidth = py_thickness_scale(plt, hasline * sp[:legendfontsize] / 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[:legendfontsize]),
markeredgecolor = py_color(single_color(get_markerstrokecolor(series)), get_markerstrokealpha(series)),
@ -1393,7 +1397,8 @@ function py_add_legend(plt::Plot, sp::Subplot, ax)
facecolor = py_color(sp[:background_color_legend]),
edgecolor = py_color(sp[:foreground_color_legend]),
framealpha = alpha(plot_color(sp[:background_color_legend])),
fancybox = false # makes the legend box square
fancybox = false, # makes the legend box square
borderpad=0.8 # to match GR legendbox
)
frame = leg."get_frame"()
frame."set_linewidth"(py_thickness_scale(plt, 1))