Help! Plots not loading

Ok thanks.

you got the second plot to work? I remember having a parabola and that sideways parabola (perhaps you can show a pic). I’m not sure why it’s not working for me then.

Sorry, as mentioned by @nilshg, only the first plot works. It creates a sideways parabola.

There is some odd behavior, here. In the second plot, the command f == .1 returns false. It’s not doing anything with an implicit function.

However plots doesn’t error, and it does change the axes making it look like there is a new plot. This is weird, since you explicitely give it the axes.

Regardless, it should be clear why f == 0.1 doesn’t do what you think it’s doing. You haven’t done anything about derivatives of used ImplicitEquations with f. It’s just a normal function.

that makes sense. I thought I’d have to since it has an x and a y

should I do :

plot!(f(x,y))

?

No that most likely will not work. Though I do not know very much about implicit functions.

Could you provide more information on what you would like to accomplish?

I want to plot the implicit derivative, and the original function, which I think is implicit, because x and y aren’t isolated.

Here’s the same error after installing v1.5.3.

Have you ever used PackageCompiler.jl?
I guess it’s probably due to previous precompilation using PackageCompiler.jl (umm… just a guess without any clue :slight_smile: ).
I’m now trying to re-precompile an image using PackageCompiler.jl.
If it works, I’ll share my result.

EDIT: in my case, this resolves the issue.

I just add the package PackageCompiler, and run my plotting just the same?

I think it’s unlikely package compiler will fix your problem.

There are plenty of other steps to do to debug before that. Have you tries running Plots outside of VS Code? In just a plan REPL?

No, I think I remember it working before though, so I could well try it. That would also be a case against something too drastic.

Your function f is never close to 0.1, it being smallest at (0,0), so there are no solutions to Eq(f(x,y),0.1) or f⩵ 0.1. Try again, with a bigger value?

Ok should I make the f or 0.1 greater? Although I can’t test, because now when I try to plot

julia> plot(∂xf ⩵ 0.1, xlims=(0, 10), ylims=(-100, 100))
#I get
ERROR: MethodError: no method matching ⩵(::typeof(∂xf), ::Float64)

Not exactly sure why the type would have changed, from the last time I ran this.

You likely need to load ImplicitEquations, which defines \Equal[tab].

As for what to make greater, presumably your 0.1, but it is your exploration, so I’ll defer. But this choice creates a graphic:

using ModelingToolkit
using Plots
using ImplicitEquations
@variables x y;
f(x,y)= sqrt((x^2+144)+(y^2+144))
 let ex = Differential(x)(f(x, y))
           func_ex = build_function(expand_derivatives(ex), x, y)
           @eval ∂xf(x, y) = ($func_ex)(x,y)
       end

using Plots
using ImplicitEquations
 
plot(∂xf ⩵ 0.1, xlims=(-10, 100), ylims=(-100, 100))
plot!(f ⩵ 20, xlims=(-10, 100), ylims=(-100, 100))

i have this problem too! i cant add Plots! please help me!

I have a problem to add Plots Pkg. please help me!

julia> Pkg.add(“Plots”)
Updating registry at C:\Users\HP\.julia\registries\General
Updating registry at C:\Users\HP\.julia\registries\JuliaComputingRegistry
Resolving package versions…
No Changes to C:\Users\HP\.julia\environments\JuliaPro_v1.5.3-1\Project.toml
No Changes to C:\Users\HP\.julia\environments\JuliaPro_v1.5.3-1\Manifest.toml

when i write using Plots. i have this error

[ Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]
Your GR installation is incomplete. Rerun build step for GR package.
ERROR: LoadError: LoadError: InitError: Evaluation into the closed module GR breaks incremental compilation because the side effects will not be permanent. This is likely due to some other module mutating GR with eval during precompilation - don’t do this.
Stacktrace:
[1] eval at .\boot.jl:331 [inlined]
[2] init() at C:\Users\HP.julia\packages\GR\RlE5Y\src\GR.jl:274
[3] _include_from_serialized(::String, ::Array{Any,1}) at .\loading.jl:697
[4] _require_search_from_serialized(::Base.PkgId, ::String) at .\loading.jl:782
[5] _require(::Base.PkgId) at .\loading.jl:1007
[6] require(::Base.PkgId) at .\loading.jl:928
[7] require(::Module, ::Symbol) at .\loading.jl:923
[8] include(::Function, ::Module, ::String) at .\Base.jl:380
[9] include at .\Base.jl:368 [inlined]
[10] include(::String) at C:\Users\HP.julia\packages\Plots\lmp2A\src\Plots.jl:1
[11] top-level scope at C:\Users\HP.julia\packages\Plots\lmp2A\src\Plots.jl:212
[12] include(::Function, ::Module, ::String) at .\Base.jl:380
[13] include(::Module, ::String) at .\Base.jl:368
[14] top-level scope at none:2
[15] eval at .\boot.jl:331 [inlined]
[16] eval(::Expr) at .\client.jl:467
[17] top-level scope at .\none:3
during initialization of module GR
in expression starting at C:\Users\HP.julia\packages\Plots\lmp2A\src\backends\gr.jl:6
in expression starting at C:\Users\HP.julia\packages\Plots\lmp2A\src\Plots.jl:212

Can you run import Pkg; Pkg.build("GR")

4 Likes

I had the same issue, after updating to the latests version of Plots, and that fixed it, but I still can’t get things to load in Pluto.

thanks my friend i do it

I had the same issue and build GR command won’t fix it.
Here is how i did fix it:
goto ~.julia\compiled\v1.6\GR
delete everything in there
run the build command again

6 Likes

This solved it for me.