Skip to content

Commit

Permalink
don't write nans into zlims (#4643)
Browse files Browse the repository at this point in the history
* don't write nans into zlims

* fix test
  • Loading branch information
BeastyBlacksmith authored Jan 27, 2023
1 parent ae88be7 commit 2142220
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/backends/plotly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ function plotly_series(plt::Plot, series::Series)

plotattributes_out[:colorbar] = plotly_colorbar(sp)

if is_2tuple(clims)
if is_2tuple(clims) && all(!isnan, clims)
plotattributes_out[:zmin], plotattributes_out[:zmax] = clims
end

Expand Down
4 changes: 3 additions & 1 deletion test/test_plotly.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using Plots, Test
with(:plotly) do
@testset "Basic" begin
@test backend() == Plots.PlotlyBackend()

pl = plot(rand(10))
@test pl isa Plot
@test pl isa Plots.Plot
@test_nowarn Plots.plotly_series(plot())
@test !haskey(Plots.plotly_series(pl)[1], :zmax)
end

@testset "Contours" begin
Expand Down

0 comments on commit 2142220

Please sign in to comment.