<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi Danielle,<br>
    <br>
    maybe you have to delete the workstation to close the PDF file (see
    also <a class="moz-txt-link-freetext" href="http://www.pyngl.ucar.edu/Functions/Ngl.delete_wks.shtml">http://www.pyngl.ucar.edu/Functions/Ngl.delete_wks.shtml</a>)<br>
    <br>
    ...<br>
    Ngl.delete_wks(wks)<br>
    Ngl.end()<br>
    <br>
    -Karin<br>
    <br>
    <br>
    <div class="moz-cite-prefix">Am 09.07.19 um 22:44 schrieb Danielle
      Touma:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAEgQBNnoS6Or076-4BfXW+zRYGpwzW63or4zTy+wXM6qcXU7NQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi Karin,
        <div><br>
        </div>
        <div>I am a new user of PyNGL (though a long-time user of NCL),
          and I really appreciate how straightforward you have made the
          transition! Well done.</div>
        <div><br>
        </div>
        <div>This may not be helpful to solve Mark's problem, but I
          would like to add that I have a similar issue with using
          Ngl.end() in the python command line. If I don't run Ngl.end()
          then my pdf does not complete the plotting (even though I run
          Ngl.frame(wks) ) and I am unable to open the pdf. If I do run
          Ngl.end(), the plotting works and I am able to open the pdf.
          However, I have to exit python and reopen it so that I can
          open a new workstation. It seems that the Ngl.end() command
          causes a disconnect from the plotting/graphics for the
          session.</div>
        <div><br>
          It might be something to do with the computing environment we
          are working on, since I tend to have some issues with Casper
          (UCAR) and graphics (XQuartz) in general.</div>
        <div><br>
        </div>
        <div>Does this help you understand the issue more? If so, do you
          have any ideas how to overcome this?</div>
        <div><br>
        </div>
        <div>Best,<br>
        </div>
        <div>Danielle</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Tue, Jul 9, 2019 at 11:56
          AM Karin Meier-Fleischer via pyngl-talk <<a
            href="mailto:pyngl-talk@ucar.edu" moz-do-not-send="true">pyngl-talk@ucar.edu</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div bgcolor="#FFFFFF"> I'm not able to reproduce the error, I
            was able to rerun it without restarting the kernel. Maybe it
            would be a good idea to delete those lines which are not
            needed like import of modules you are not using. Start with
            a short clean script and use more code cells. If you want to
            display the plot inline you can produce a PNG file, see
            attached notebook. <br>
            <br>
            -Karin<br>
            <br>
            <div class="gmail-m_6182923316836806705moz-cite-prefix">Am
              09.07.19 um 19:18 schrieb Mark England:<br>
            </div>
            <blockquote type="cite"> Hi Karin,
              <div><br>
              </div>
              <div>Attached. It is very simple and doesn’t need any data
                (just map plotting). </div>
              <div>If you run it once, it should work, however if you
                rerun the plotting cell (perhaps try to change the
                latitude or something) it will give you that error.</div>
              <div><br>
              </div>
              <div>Mark<br>
              </div>
              <br>
              <fieldset
                class="gmail-m_6182923316836806705mimeAttachmentHeader"></fieldset>
              <div>
                <div><br>
                  <blockquote type="cite">
                    <div>On 9 Jul 2019, at 10:02, Karin Meier-Fleischer
                      <<a href="mailto:meier-fleischer@dkrz.de"
                        target="_blank" moz-do-not-send="true">meier-fleischer@dkrz.de</a>>
                      wrote:</div>
                    <br
                      class="gmail-m_6182923316836806705Apple-interchange-newline">
                    <div>
                      <div style="overflow-wrap: break-word;">Hi Mark,
                        <div><br>
                        </div>
                        <div>sometimes I have similar problems using
                          notebook and PyNGL running with the same
                          preconditions and have to restart the kernel.
                          I don’t know if it is caused by PyNGL because
                          I get other error messages. Is it possible to
                          send the .ipynb file with test data to try to
                          reproduce your errors?</div>
                        <div><br>
                        </div>
                        <div>-Karin<br>
                          <div><br>
                            <blockquote type="cite">
                              <div>Am 09.07.2019 um 18:52 schrieb Mark
                                England via pyngl-talk <<a
                                  href="mailto:pyngl-talk@ucar.edu"
                                  target="_blank" moz-do-not-send="true">pyngl-talk@ucar.edu</a>>:</div>
                              <br
                                class="gmail-m_6182923316836806705Apple-interchange-newline">
                              <div>
                                <div style="overflow-wrap: break-word;">
                                  <div>Hi there,</div>
                                  <div><br>
                                  </div>
                                  <div>I am trying to transition to
                                    using PyNGL (using Jupiter Notebook,
                                    Python v3.7.3) on my Mac (Mojave
                                    10.14.5).</div>
                                  <div>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.</div>
                                  <div>However if I re-run the plotting
                                    section of code in the Notebook, I
                                    get this error:</div>
                                  <div><br>
                                  </div>
                                  <div>
                                    <div
style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span
style="font-variant-ligatures:no-common-ligatures">fatal:["Error.c":406]:ErrorInitialize:Only
                                        one instance of ErrorClass is
                                        supported</span></div>
                                    <div
style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span
style="font-variant-ligatures:no-common-ligatures">fatal:Unable to
                                        initialize layer-Can't Create</span></div>
                                    <div
style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span
style="font-variant-ligatures:no-common-ligatures">fatal:Error Creating
                                        ErrorClass object</span></div>
                                    <div
style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span
style="font-variant-ligatures:no-common-ligatures">fatal:Unable to
                                        initialize layer-Can't Create</span></div>
                                    <div
style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span
style="font-variant-ligatures:no-common-ligatures">fatal:Unable to
                                        initialize layer-Can't Create</span></div>
                                    <div
style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span
style="font-variant-ligatures:no-common-ligatures">fatal:_NhlCreate:Unable
                                        to access "default" App object</span></div>
                                    <div
style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span
style="font-variant-ligatures:no-common-ligatures">fatal:_NhlCreate:Invalid
                                        Parent id #-4</span></div>
                                    <div
style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span
style="font-variant-ligatures:no-common-ligatures">fatal:NhlGetValues:PID
                                        #-4 is invalid</span></div>
                                    <div
style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span
style="font-variant-ligatures:no-common-ligatures">fatal:PID #-4 can't
                                        be found in NhlSetValues</span></div>
                                    <div
style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span
style="font-variant-ligatures:no-common-ligatures">warning:maximize_plots:
                                        Invalid workstation. No plot
                                        maximization can take place.</span></div>
                                    <div
style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span
style="font-variant-ligatures:no-common-ligatures">fatal:NhlDraw:
                                        Invalid Layer Id: -4</span></div>
                                    <div
style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span
style="font-variant-ligatures:no-common-ligatures">fatal:Unable to
                                        update Workstation with PID#-4</span></div>
                                    <div
style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span
style="font-variant-ligatures:no-common-ligatures">fatal:Unable to clear
                                        Workstation with PID#-4</span></div>
                                    <div
style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span
style="font-variant-ligatures:no-common-ligatures">fatal:NhlDraw:
                                        Invalid Layer Id: -4</span></div>
                                    <div
style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span
style="font-variant-ligatures:no-common-ligatures">fatal:Unable to
                                        update Workstation with PID#-4</span></div>
                                    <div
style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span
style="font-variant-ligatures:no-common-ligatures">fatal:Unable to clear
                                        Workstation with PID#-4</span></div>
                                    <div
style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span
style="font-variant-ligatures:no-common-ligatures">fatal:Unable to
                                        Destroy (Bad PID#0)</span></div>
                                  </div>
                                  <div
style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span
style="font-variant-ligatures:no-common-ligatures"><br>
                                    </span></div>
                                  <span>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.</span>
                                  <div><span><br>
                                    </span></div>
                                  <div><span>Thanks,</span></div>
                                  <div><span><br>
                                    </span></div>
                                  <div><span>Mark</span></div>
                                </div>
_______________________________________________<br>
                                pyngl-talk mailing list<br>
                                List instructions, subscriber options,
                                unsubscribe:<br>
                                <a
                                  href="http://mailman.ucar.edu/mailman/listinfo/pyngl-talk"
                                  target="_blank" moz-do-not-send="true">http://mailman.ucar.edu/mailman/listinfo/pyngl-talk</a></div>
                            </blockquote>
                          </div>
                          <br>
                          <div>
                            <div
style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
                              <div
style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </blockquote>
                </div>
                <br>
                <div>
                  <div dir="auto"
style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
                    <div dir="auto"
style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
                      <div dir="auto" style="overflow-wrap: break-word;">
                        <div
style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
                          <div
style="font-variant-ligatures:normal;font-variant-east-asian:normal;line-height:normal"><font
                              face="Garamond" color="#747474">Mark
                              England, PhD.</font></div>
                          <div
style="font-variant-ligatures:normal;font-variant-east-asian:normal;line-height:normal"><font
                              face="Garamond" color="#747474">Columbia
                              University,</font></div>
                          <div
style="font-variant-ligatures:normal;font-variant-east-asian:normal;line-height:normal"><font
                              face="Garamond" color="#747474"><i>Bakhmeteff
                                Research Fellow in Fluid Mechanics, </i></font></div>
                          <div
style="font-variant-ligatures:normal;font-variant-east-asian:normal;line-height:normal"><font
                              face="Garamond" color="#747474">Email: <a
                                href="mailto:mre2126@columba.edu"
                                target="_blank" moz-do-not-send="true">mre2126@columbia.edu</a>, <a
                                href="mailto:markengland20@gmail.com"
                                target="_blank" moz-do-not-send="true">markengland20@gmail.com</a></font></div>
                          <div
style="font-variant-ligatures:normal;font-variant-east-asian:normal;line-height:normal"><font
                              face="Garamond" color="#747474">Website: <a
                                href="http://markrossengland.com"
                                target="_blank" moz-do-not-send="true">markrossengland.com</a></font></div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
                <br>
              </div>
            </blockquote>
            <br>
            <pre class="gmail-m_6182923316836806705moz-signature" cols="72">-- 
Dipl. Geophys. Karin Meier-Fleischer
Visualization, NCL, CDO, PyNGL
Application Support

Deutsches Klimarechenzentrum GmbH (DKRZ)
Bundesstrasse 45a - D20146 Hamburg - Germany

Phone:    +49 (0)40 460094 126
Fax:      +49 (0)40 460094 270
E-Mail:   <a class="gmail-m_6182923316836806705moz-txt-link-abbreviated" href="mailto:meier-fleischer@dkrz.de" target="_blank" moz-do-not-send="true">meier-fleischer@dkrz.de</a>
URL:      <a class="gmail-m_6182923316836806705moz-txt-link-abbreviated" href="http://www.dkrz.de" target="_blank" moz-do-not-send="true">www.dkrz.de</a>

Geschäftsführer: Prof. Dr. Thomas Ludwig
Sitz der Gesellschaft: Hamburg
Amtsgericht Hamburg HRB 39784
</pre>
          </div>
          _______________________________________________<br>
          pyngl-talk mailing list<br>
          List instructions, subscriber options, unsubscribe:<br>
          <a href="http://mailman.ucar.edu/mailman/listinfo/pyngl-talk"
            rel="noreferrer" target="_blank" moz-do-not-send="true">http://mailman.ucar.edu/mailman/listinfo/pyngl-talk</a></blockquote>
      </div>
      <br clear="all">
      <div><br>
      </div>
      -- <br>
      <div dir="ltr" class="gmail_signature">
        <div dir="ltr"><b>Danielle Touma</b>
          <div>Postdoctoral Scholar</div>
          <div>Bren School of Environmental Science & Management</div>
          <div>University of California, Santa Barbara</div>
          <div><a href="mailto:touma@ucsb.edu" target="_blank"
              moz-do-not-send="true">touma@ucsb.edu</a></div>
          <div>(919) 449-6377</div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>