diff --git a/src/layouts.jl b/src/layouts.jl index 9440da31..90892adf 100644 --- a/src/layouts.jl +++ b/src/layouts.jl @@ -479,6 +479,8 @@ function build_layout(layout::GridLayout, n::Integer) append!(subplots, sps) merge!(spmap, m) i += length(sps) + elseif isa(l, Subplot) + error("Subplot exists. Cannot re-use existing layout. Please make a new one.") end i >= n && break # only add n subplots end diff --git a/src/utils.jl b/src/utils.jl index 1fdab38f..a0009d64 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -152,7 +152,7 @@ function iter_segments(args...) end # helpers to figure out if there are NaN values in a list of array types -anynan(i::Int, args...) = any(a -> isnan(cycle(a,i)), args) +anynan(i::Int, args...) = any(a -> !isfinite(cycle(a,i)), args) anynan(istart::Int, iend::Int, args...) = any(i -> anynan(i, args...), istart:iend) allnan(istart::Int, iend::Int, args...) = all(i -> anynan(i, args...), istart:iend)