Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plots no longer accepts functions as clims #261

Closed
glwagner opened this issue Nov 4, 2021 · 7 comments · Fixed by #288
Closed

Plots no longer accepts functions as clims #261

glwagner opened this issue Nov 4, 2021 · 7 comments · Fixed by #288
Labels
🐞 bug Something isn't working 📔 documentation

Comments

@glwagner
Copy link
Member

glwagner commented Nov 4, 2021

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:

for m in 1:nlayers
p[(m-1) * 3 + 1][1][:z] = Array(vars.q[:, :, m])
p[(m-1) * 3 + 2][1][:z] = Array(vars.ψ[:, :, m])
end

discovered by @szy21

@navidcy navidcy added 🐞 bug Something isn't working 📔 documentation labels Nov 4, 2021
@navidcy
Copy link
Member

navidcy commented Nov 5, 2021

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

@navidcy
Copy link
Member

navidcy commented Nov 5, 2021

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

@navidcy
Copy link
Member

navidcy commented Nov 7, 2021

#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

@glwagner
Copy link
Member Author

glwagner commented Nov 8, 2021

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

@szy21
Copy link
Collaborator

szy21 commented Nov 8, 2021

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

Oh, I know I would have done something wrong!

@navidcy
Copy link
Member

navidcy commented Nov 8, 2021

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

@glwagner
Copy link
Member Author

glwagner commented Nov 9, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 📔 documentation
Projects
None yet
3 participants