diff --git a/src/backends/plotly.jl b/src/backends/plotly.jl index 0e69bb17..2fff6cb7 100644 --- a/src/backends/plotly.jl +++ b/src/backends/plotly.jl @@ -388,6 +388,7 @@ function plotly_layout(plt::Plot) :bgcolor => rgba_string(sp[:background_color_legend]), :bordercolor => rgba_string(sp[:foreground_color_legend]), :font => plotly_font(legendfont(sp)), + :tracegroupgap => 0, :x => xpos, :y => ypos ) @@ -664,8 +665,8 @@ function plotly_series_shapes(plt::Plot, series::Series) :xaxis => "x$(x_idx)", :yaxis => "y$(y_idx)", :name => series[:label], + :legendgroup => series[:label], ) - # d_base[:legendgroup] = series[:label] x, y = (plotly_data(series, letter, data) for (letter, data) in zip((:x, :y), shape_data(series)) @@ -722,6 +723,7 @@ function plotly_series_segments(series::Series, d_base::KW, x, y, z) d_out = deepcopy(d_base) d_out[:showlegend] = i==1 ? should_add_to_legend(series) : false + d_out[:legendgroup] = series[:label] # set the type if st in (:path, :scatter, :scattergl, :straightline)