ArgumentError: hasproperty of NULL PyObject using PyPlot in julia 1.5.3 in JupyterNotebook

Viewed 415

I am a total newby at Julia but I've managed to do things with it using Atom. However, I kind of like writing in Jupyternotebook and thought I'd play around with things that have been working in Atom in notebooks.

But it does work. Take these line of code, for instance:

using PyPlot;
x = collect(Float16, range(0,pi,length=100));
y = collect(Float16, range(0,pi,length=100));
z = x.^2 + y.^2
surf(x,y,z);
PyPlot.display_figs()

They should return this (as they do in Atom)

enter image description here

But I get:

ArgumentError: hasproperty of NULL PyObject

Stacktrace:
 [1] pyhasproperty(::PyCall.PyObject, ::String) at C:\Users\k_sego\.julia\packages\PyCall\BcTLp\src\PyCall.jl:359
 [2] hasproperty at C:\Users\k_sego\.julia\packages\PyCall\BcTLp\src\PyCall.jl:365 [inlined]
 [3] gca(; kws::Base.Iterators.Pairs{Symbol,String,Tuple{Symbol},NamedTuple{(:projection,),Tuple{String}}}) at C:\Users\k_sego\.julia\packages\PyPlot\XHEG0\src\PyPlot.jl:174
 [4] plot_trisurf(::Array{Float16,1}, ::Vararg{Array{Float16,1},N} where N; kws::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at C:\Users\k_sego\.julia\packages\PyPlot\XHEG0\src\plot3d.jl:61
 [5] plot_trisurf at C:\Users\k_sego\.julia\packages\PyPlot\XHEG0\src\plot3d.jl:60 [inlined]
 [6] #surf#188 at C:\Users\k_sego\.julia\packages\PyPlot\XHEG0\src\plot3d.jl:94 [inlined]
 [7] surf(::Array{Float16,1}, ::Array{Float16,1}, ::Array{Float16,1}) at C:\Users\k_sego\.julia\packages\PyPlot\XHEG0\src\plot3d.jl:94
 [8] top-level scope at In[81]:6
 [9] include_string(::Function, ::Module, ::String, ::String) at .\loading.jl:1091

I've tried a variety of things....but with no luck. Glad for any help.

0 Answers
Related