GeophysicalFlows.jl icon indicating copy to clipboard operation
GeophysicalFlows.jl copied to clipboard

`Plots` no longer accepts functions as `clims`

Open glwagner opened this issue 4 years ago • 7 comments

When I run examples/multilayerqg_2layer.jl on a fresh clone on Julia 1.6.2 I get an error:

julia> include("multilayerqg_2layer.jl")
[ Info: Precompiling GeophysicalFlows [44ee3b1c-bc02-53fa-8355-8e347616e15e]
WARNING: could not import Printf.ini_hex into BFloat16s
WARNING: could not import Printf.ini_HEX into BFloat16s
[ Info: FourierFlows will use 8 threads
[ Info: FourierFlows will use 8 threads
[ Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]
step: 0000, t: 0.0, cfl: 0.00, KE₁: 1.155e-08, KE₂: 5.483e-08, PE: 2.958e-09, walltime: 0.01 min
[ Info: Precompiling GR_jll [d2c73de3-f751-5644-a686-071e5b155ba9]
ERROR: LoadError: MethodError: no method matching iterate(::typeof(symlims))
Closest candidates are:
  iterate(::Union{LinRange, StepRangeLen}) at range.jl:664
  iterate(::Union{LinRange, StepRangeLen}, ::Int64) at range.jl:664
  iterate(::T) where T<:Union{Base.KeySet{var"#s79", var"#s78"} where {var"#s79", var"#s78"<:Dict}, Base.ValueIterator{var"#s77"} where var"#s77"<:Dict} at dict.jl:693
  ...

Is it the case that Plots no longer accepts function arguments to clims?

It's not so easy to fix the issue because some wizardry is used to update the plot data:

https://github.com/FourierFlows/GeophysicalFlows.jl/blob/dbd91a3a28ef9246c67e6f1f49e849640b8d3561/examples/multilayerqg_2layer.jl#L217-L220

discovered by @szy21

glwagner avatar Nov 04 '21 03:11 glwagner

hm... indeed seems like this is the case :(

navidcy avatar Nov 05 '21 04:11 navidcy

I think this is just another extra small reason to go to some X-Makie.jl for plotting. See #209.

navidcy avatar Nov 05 '21 21:11 navidcy

#263 adds compat Plots entry with upper bound v1.21.3. This is the latest version of Plots.jl for which clims = ::Function seems to work OK.

This is not the cleanest fix. Let's leave the issue open until we transition to X-Makie.jl

navidcy avatar Nov 07 '21 09:11 navidcy

Ah, @szy21 this suggests that both of us simply had an outdated version of Plots...

glwagner avatar Nov 08 '21 17:11 glwagner

Ah, @szy21 this suggests that both of us simply had an outdated version of Plots...

Oh, I know I would have done something wrong!

szy21 avatar Nov 08 '21 17:11 szy21

No, probably you had the latest version of Plots! Any version >v1.21.3 shows this problem!

navidcy avatar Nov 08 '21 23:11 navidcy

Oh sorry I was confused. Our version of Plots was too new.

glwagner avatar Nov 09 '21 01:11 glwagner