Fix for regression
This commit is contained in:
parent
9941563b0b
commit
7197127abe
@ -5,11 +5,14 @@ process_clims(s::Union{Symbol,Nothing,Missing}) = ignorenan_extrema
|
||||
# don't specialize on ::Function otherwise python functions won't work
|
||||
process_clims(f) = f
|
||||
|
||||
get_clims(sp::Subplot)::Tuple{Float64,Float64} = sp[:crange]
|
||||
get_clims(series::Series)::Tuple{Float64,Float64} = series[:crange]
|
||||
const sp_clims = Dict{Subplot, Tuple{Float64, Float64}}()
|
||||
const series_clims = Dict{Series, Tuple{Float64, Float64}}()
|
||||
|
||||
get_clims(sp::Subplot)::Tuple{Float64,Float64} = sp_clims[sp]
|
||||
get_clims(series::Series)::Tuple{Float64,Float64} = series_clims[series]
|
||||
|
||||
get_clims(sp::Subplot, series::Series)::Tuple{Float64,Float64} =
|
||||
series[:colorbar_entry] ? sp[:crange] : series[:crange]
|
||||
series[:colorbar_entry] ? sp_clims[sp] : series_clims[series]
|
||||
|
||||
function update_clims(sp::Subplot, op = process_clims(sp[:clims]))::Tuple{Float64,Float64}
|
||||
zmin, zmax = Inf, -Inf
|
||||
@ -20,12 +23,11 @@ function update_clims(sp::Subplot, op = process_clims(sp[:clims]))::Tuple{Float6
|
||||
update_clims(series, op)
|
||||
end
|
||||
end
|
||||
return sp[:crange] = zmin <= zmax ? (zmin, zmax) : (NaN, NaN)
|
||||
return sp_clims[sp] = zmin <= zmax ? (zmin, zmax) : (NaN, NaN)
|
||||
end
|
||||
|
||||
"""
|
||||
update_clims(::Series, op=Plots.ignorenan_extrema)
|
||||
|
||||
Finds the limits for the colorbar by taking the "z-values" for the series and passing them into `op`,
|
||||
which must return the tuple `(zmin, zmax)`. The default op is the extrema of the finite
|
||||
values of the input. The value is stored as a series property, which is retrieved by `get_clims`.
|
||||
@ -45,7 +47,7 @@ function update_clims(series::Series, op = ignorenan_extrema)::Tuple{Float64,Flo
|
||||
zmin, zmax = _update_clims(zmin, zmax, op(vals)...)
|
||||
end
|
||||
end
|
||||
return series[:crange] = zmin <= zmax ? (zmin, zmax) : (NaN, NaN)
|
||||
return series_clims[series] = zmin <= zmax ? (zmin, zmax) : (NaN, NaN)
|
||||
end
|
||||
|
||||
_update_clims(zmin, zmax, emin, emax) = NaNMath.min(zmin, emin), NaNMath.max(zmax, emax)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user