From 0fa459d590a38c4529bd1d17346ed9b36a3f97e1 Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Fri, 21 Jul 2017 10:52:36 +0200 Subject: [PATCH] fix alpha in legend markers --- src/backends/gr.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/backends/gr.jl b/src/backends/gr.jl index a3a40caf..4c36bf00 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -272,6 +272,10 @@ function normalize_zvals(zv::AVec) end end + +gr_alpha(α::Void) = 1 +gr_alpha(α::Real) = α + # --------------------------------------------------------- # draw ONE Shape @@ -1042,6 +1046,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) if sp[:legendtitle] != nothing GR.settextalign(GR.TEXT_HALIGN_CENTER, GR.TEXT_VALIGN_HALF) gr_set_textcolor(sp[:foreground_color_legend]) + GR.settransparency(1) gr_text(xpos - 0.03 + 0.5*w, ypos, string(sp[:legendtitle])) ypos -= dy end @@ -1056,11 +1061,14 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) b, t = ypos-0.4dy, ypos+0.4dy x = [l, r, r, l, l] y = [b, b, t, t, b] + GR.settransparency(gr_alpha(series[:fillalpha])) gr_polyline(x, y, GR.fillarea) + GR.settransparency(gr_alpha(series[:linealpha])) st == :shape && gr_polyline(x, y) end if st == :path + GR.settransparency(gr_alpha(series[:linealpha])) if series[:fillrange] == nothing || series[:ribbon] != nothing GR.polyline([xpos - 0.07, xpos - 0.01], [ypos, ypos]) else