anynan isfinite; error on reusing layout

This commit is contained in:
Thomas Breloff 2016-06-15 15:36:36 -04:00
parent a5ddebf44d
commit e5c4f782a5
2 changed files with 3 additions and 1 deletions

View File

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

View File

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