From 2a4b74d0fff7e92a3972fed97f3d076f413eed0b Mon Sep 17 00:00:00 2001 From: wfrgra Date: Tue, 31 Mar 2020 19:38:47 +1100 Subject: [PATCH] renamed new legend setting from :label to :inline --- src/arg_desc.jl | 2 +- src/args.jl | 2 +- src/backends/gr.jl | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/arg_desc.jl b/src/arg_desc.jl index 7b7e5283..f9237bee 100644 --- a/src/arg_desc.jl +++ b/src/arg_desc.jl @@ -89,7 +89,7 @@ const _arg_desc = KW( :foreground_color_legend => "Color Type or `:match` (matches `:foreground_color_subplot`). Foreground color of the legend.", :foreground_color_title => "Color Type or `:match` (matches `:foreground_color_subplot`). Color of subplot title.", :color_palette => "Vector of colors (cycle through) or color gradient (generate list from gradient) or `:auto` (generate a color list using `Colors.distiguishable_colors` and custom seed colors chosen to contrast with the background). The color palette is a color list from which series colors are automatically chosen.", -:legend => "Bool (show the legend?) or Symbol (legend position). Symbol values: `:none`, `:best`, `:right`, `:left`, `:top`, `:bottom`, `:inside`, `:legend`, `:topright`, `:topleft`, `:bottomleft`, `:bottomright` (note: only some may be supported in each backend)", +:legend => "Bool (show the legend?) or Symbol (legend position). Symbol values: `:none`, `:best`, `:right`, `:left`, `:top`, `:bottom`, `:inside`, `:legend`, `:topright`, `:topleft`, `:bottomleft`, `:bottomright` , `:inline` (note: only some may be supported in each backend)", :legendfontfamily => "String or Symbol. Font family of legend entries.", :legendfontsize => "Integer. Font pointsize of legend entries.", :legendfonthalign => "Symbol. Font horizontal alignment of legend entries: :hcenter, :left, :right or :center", diff --git a/src/args.jl b/src/args.jl index a217494b..3aa2395e 100644 --- a/src/args.jl +++ b/src/args.jl @@ -1252,7 +1252,7 @@ function convertLegendValue(val::Symbol) :best elseif val in (:no, :none) :none - elseif val in (:right, :left, :top, :bottom, :inside, :best, :legend, :topright, :topleft, :bottomleft, :bottomright, :outertopright, :outertopleft, :outertop, :outerright, :outerleft, :outerbottomright, :outerbottomleft, :outerbottom, :label) + elseif val in (:right, :left, :top, :bottom, :inside, :best, :legend, :topright, :topleft, :bottomleft, :bottomright, :outertopright, :outertopleft, :outertop, :outerright, :outerleft, :outerbottomright, :outerbottomleft, :outerbottom, :inline) val else error("Invalid symbol for legend: $val") diff --git a/src/backends/gr.jl b/src/backends/gr.jl index 63ed42df..1419275b 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -1043,7 +1043,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) viewport_plotarea[3] += legendh + 0.04 end end - if sp[:legend] == :label + if sp[:legend] == :inline viewport_plotarea[2] -= legendw end @@ -1801,7 +1801,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) gr_text(GR.wctondc(xi, yi)..., str) end - if sp[:legend] == :label && should_add_to_legend(series) + if sp[:legend] == :inline && should_add_to_legend(series) gr_set_font(legendfont(sp)) GR.settextalign(GR.TEXT_HALIGN_LEFT, GR.TEXT_VALIGN_HALF) gr_set_textcolor(plot_color(sp[:legendfontcolor])) @@ -1815,7 +1815,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) hascolorbar(sp) && gr_draw_colorbar(cbar, sp, get_clims(sp)) # add the legend - if !(sp[:legend] in(:none, :label)) + if !(sp[:legend] in(:none, :inline)) GR.savestate() GR.selntran(0) GR.setscale(0)