From 594c39698e3ef14d8c3097fb4ae62e581111d004 Mon Sep 17 00:00:00 2001 From: Nathan Daly Date: Wed, 21 Nov 2018 17:06:27 -0500 Subject: [PATCH] Add `showlegend` option to allow a series to opt out of being in the legend --- src/args.jl | 1 + src/subplots.jl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/args.jl b/src/args.jl index 1065f12e..874a7a8b 100644 --- a/src/args.jl +++ b/src/args.jl @@ -279,6 +279,7 @@ const _series_defaults = KW( :series_annotations => nothing, # a list of annotations which apply to the coordinates of this series :primary => true, # when true, this "counts" as a series for color selection, etc. the main use is to allow # one logical series to be broken up (path and markers, for example) + :showlegend => true, # when false, this series will be left out of the generated legend. :hover => nothing, # text to display when hovering over the data points :stride => (1,1), # array stride for wireframe/surface, the first element is the row stride and the second is the column stride. ) diff --git a/src/subplots.jl b/src/subplots.jl index c10b1c27..4ff395fb 100644 --- a/src/subplots.jl +++ b/src/subplots.jl @@ -47,7 +47,7 @@ function should_add_to_legend(series::Series) :hexbin,:bins2d,:histogram2d,:hline,:vline, :contour,:contourf,:contour3d,:surface,:wireframe, :heatmap, :pie, :image - )) + )) && series.plotattributes[:showlegend] == true end # ----------------------------------------------------------------------