Plots.GRBackend Error

Hey everyone,

I’m working on this CFD code with its author:

https://github.com/weymouth/WaterLily.jl

When running an example like “TwoD_Circle.jl”, I get the following error:

LoadError: MethodError: no method matching _as_gradient(::Array{RGBA{Float64},1})
Closest candidates are:
  _as_gradient(!Matched::ColorGradient) at /home/ma22ws/.julia/packages/Plots/8GUYs/src/utils.jl:136
  _as_gradient(!Matched::Colorant) at /home/ma22ws/.julia/packages/Plots/8GUYs/src/utils.jl:137
(...)

The author cannot reproduce the error and it seems to be a problem with GRBackend on my system.
I have tried to purge Plots and rebuild it but to no avail.

For reference, I am running this from Juno, using its shipped 1.5.4 version binary on Linux x86_64.
However, if I run the code “manually” on the REPL using my system’s Julia (version 1.5.3), everything works fine.

Thank you all,

Miguel

1 Like

A quick idea: I had a similar problem recently. Does your editor maybe start the Julia process with any additional options such as --math-mode=fast? That was what was causing the issue for me at least, so maybe it helps to remove these.

It looks like you need to at least have this commit from Plots.jl v1.1.0

What does ]st Plots or using Pkg; Pkg.status("Plots") evaluate to in Juno?

How can I check which flags are being passed during startup? I couldn’t find any signs of there being custom flags in the editor.
Many functions in this code use @fastmath so I’m not sure that’s a viable solution.
In any case, thanks!

Hi, that’s interesting…could explain why it works on my system version works but not with the Juno binary.

This is the output:

Project WaterLily v0.1.0
Status `~/Documents/WaterLily/WaterLily.jl-master/Project.toml`
  [91a5bcdd] Plots v1.0.14

Any ideas?

Thanks for your help.

In Atom there is a “Juno” section at the top of the window. Clicking there you should be able to find the settings at the bottom of the list.
Although suppose these flags won’t be there unless you added them yourself. Anyway it was worth a shot i guess :D.

I can confirm there’s nothing out ordinary there. But you’re right, the “devil” tends to be in the details.
Oh well…let’s see if it’s a version issue…

Thanks!

1 Like