From f05237c5fc863cb88a77df4f83a90f099c7f0de7 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Tue, 25 Jan 2022 15:44:43 +0100 Subject: [PATCH] fix plotting empty plot for plotly --- src/backends/plotly.jl | 3 +++ test/test_plotly.jl | 1 + 2 files changed, 4 insertions(+) diff --git a/src/backends/plotly.jl b/src/backends/plotly.jl index 94073d00..1b7c8a82 100644 --- a/src/backends/plotly.jl +++ b/src/backends/plotly.jl @@ -1031,6 +1031,9 @@ end # get a list of dictionaries, each representing the series params function plotly_series(plt::Plot) + if isempty(plt.series_list) + return KW[] + end reduce(vcat, plotly_series(plt, series) for series in plt.series_list) end diff --git a/test/test_plotly.jl b/test/test_plotly.jl index 0758c410..e6cd20a9 100644 --- a/test/test_plotly.jl +++ b/test/test_plotly.jl @@ -7,6 +7,7 @@ using Plots, Test p = plot(rand(10)) @test isa(p, Plots.Plot) == true + @test_nowarn Plots.plotly_series(plot()) end @testset "Contours" begin