From e555f679c18351424ec402f4f5fc2f7cb9320a0c Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Mon, 26 Aug 2019 10:55:46 +0200 Subject: [PATCH] implementation for GR --- src/backends/gr.jl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/backends/gr.jl b/src/backends/gr.jl index effe89bc..ccaf914a 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -879,12 +879,13 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) GR.savestate() GR.selntran(0) GR.setscale(0) - gr_set_font(legendfont(sp)) if sp[:legendtitle] !== nothing + gr_set_font(legendtitlefont(sp)) tbx, tby = gr_inqtext(0, 0, string(sp[:legendtitle])) legendw = tbx[3] - tbx[1] legendn += 1 end + gr_set_font(legendfont(sp)) for series in series_list(sp) should_add_to_legend(series) || continue legendn += 1 @@ -1498,10 +1499,10 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) i = 0 if sp[:legendtitle] !== nothing GR.settextalign(GR.TEXT_HALIGN_CENTER, GR.TEXT_VALIGN_HALF) - gr_set_textcolor(sp[:legendfontcolor]) - gr_set_transparency(sp[:legendfontcolor]) + gr_set_font(legendtitlefont(sp)) gr_text(xpos - 0.03 + 0.5*w, ypos, string(sp[:legendtitle])) ypos -= dy + gr_set_font(legendfont(sp)) end for series in series_list(sp) should_add_to_legend(series) || continue