From e5c4f782a578ba70d1f83074c2dc294bd980c4b0 Mon Sep 17 00:00:00 2001 From: Thomas Breloff Date: Wed, 15 Jun 2016 15:36:36 -0400 Subject: [PATCH] anynan isfinite; error on reusing layout --- src/layouts.jl | 2 ++ src/utils.jl | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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)