fix plotting empty plot for plotly (#4067)

This commit is contained in:
Simon Christ 2022-01-25 17:14:07 +01:00 committed by GitHub
parent 91bb983c08
commit 2eaf9f3b15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -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

View File

@ -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