Allow legend opacity for pgfplots.
This commit is contained in:
parent
b6f7c8bc4b
commit
faf6ea72e0
@ -476,16 +476,10 @@ function _update_plot_object(plt::Plot{PGFPlotsBackend})
|
|||||||
if haskey(_pgfplots_legend_pos, legpos)
|
if haskey(_pgfplots_legend_pos, legpos)
|
||||||
kw[:legendPos] = _pgfplots_legend_pos[legpos]
|
kw[:legendPos] = _pgfplots_legend_pos[legpos]
|
||||||
end
|
end
|
||||||
cstr, a = pgf_color(plot_color(sp[:background_color_legend]))
|
cstr, bg_alpha = pgf_color(plot_color(sp[:background_color_legend]))
|
||||||
a == 0 && (cstr = "none")
|
fg_alpha = alpha(plot_color(sp[:foreground_color_legend]))
|
||||||
|
|
||||||
if hasfield(typeof(sp[:foreground_color_legend]), :alpha) && sp[:foreground_color_legend].alpha == 0
|
push!(style, string("legend style = {", pgf_linestyle(pgf_thickness_scaling(sp), sp[:foreground_color_legend], fg_alpha, "solid", ), ",", "fill = $cstr,", "fill opacity = $bg_alpha,", "text opacity = 1,", "font = ", pgf_font(sp[:legendfontsize], pgf_thickness_scaling(sp)), "}"))
|
||||||
legend_linestyle = "draw = none"
|
|
||||||
else
|
|
||||||
legend_linestyle = pgf_linestyle(pgf_thickness_scaling(sp), sp[:foreground_color_legend], 1.0, "solid", )
|
|
||||||
end
|
|
||||||
|
|
||||||
push!(style, string("legend style = {", legend_linestyle, ",", "fill = $cstr,", "font = ", pgf_font(sp[:legendfontsize], pgf_thickness_scaling(sp)), "}"))
|
|
||||||
|
|
||||||
if any(s[:seriestype] == :contour for s in series_list(sp))
|
if any(s[:seriestype] == :contour for s in series_list(sp))
|
||||||
kw[:view] = "{0}{90}"
|
kw[:view] = "{0}{90}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user