[pyngl-talk] Problems with plotting in Jupyter notebook cells

Mark England markengland20 at gmail.com
Tue Jul 9 10:52:13 MDT 2019


Hi there,

I am trying to transition to using PyNGL (using Jupiter Notebook, Python v3.7.3) on my Mac (Mojave 10.14.5).
I am just trying to create simple plots (code below, mostly taken from the examples online. When I run the script first, it works fine and the pdf is created exactly as advertised. All the relevant modules are loaded.
However if I re-run the plotting section of code in the Notebook, I get this error:

fatal:["Error.c":406]:ErrorInitialize:Only one instance of ErrorClass is supported
fatal:Unable to initialize layer-Can't Create
fatal:Error Creating ErrorClass object
fatal:Unable to initialize layer-Can't Create
fatal:Unable to initialize layer-Can't Create
fatal:_NhlCreate:Unable to access "default" App object
fatal:_NhlCreate:Invalid Parent id #-4
fatal:NhlGetValues:PID #-4 is invalid
fatal:PID #-4 can't be found in NhlSetValues
warning:maximize_plots: Invalid workstation. No plot maximization can take place.
fatal:NhlDraw: Invalid Layer Id: -4
fatal:Unable to update Workstation with PID#-4
fatal:Unable to clear Workstation with PID#-4
fatal:NhlDraw: Invalid Layer Id: -4
fatal:Unable to update Workstation with PID#-4
fatal:Unable to clear Workstation with PID#-4
fatal:Unable to Destroy (Bad PID#0)

I can only get the figure again, if, in the Kernel menu, I ‘restart and run all’. It seems to be a problem with the graphics? I have xQuartz installed. From a similar topic I found online, they removed Ngl.end() at the end, however that doesn’t work for me.

Thanks,

Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/pyngl-talk/attachments/20190709/50803ee9/attachment.html>


More information about the pyngl-talk mailing list