<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: matplotlib.pyplot.show() crashes ArcGIS in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576293#M45188</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So the trick is to track down the source of the error. I edited the code to simplify it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import ConversionUtils
import arcpy 
from arcpy import env 
import matplotlib.pyplot as plt
xLabelName = "x label"
yLabelName = "y_label"
title = "Title"
fig = plt.figure()
plt.plot(range(10), range(10))
plt.xlabel(xLabelName, fontsize = 14) 
plt.ylabel(yLabelName, fontsize = 14) 
plt.title(str(title), fontsize = 16)
plt.grid() 
plt.savefig("f:/test/abc.png") 
plt.show()&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically I got rid of all that conversion stuff and tried to get output as a graph (see image) and as a file (see file).&lt;/P&gt;&lt;P&gt;It works...ergo...your problem is with your inputs using that ConversionUtils stuff.&amp;nbsp; At least your have a start point.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="mpl_demo_line.png" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/164421_mpl_demo_line.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 00:48:34 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2021-12-12T00:48:34Z</dc:date>
    <item>
      <title>matplotlib.pyplot.show() crashes ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576290#M45185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone!&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;SPAN class="kwd"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;I'm creating a customizing tools in arcgis. I want to show some diagrams in arcgis, which made by matplotlib.&lt;/P&gt;&lt;P&gt;Everything works fine, the diagram kann even be saved in the right way, except when I show the plot through &lt;CODE&gt;&lt;SPAN class="pln"&gt;plt&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;show&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;()&lt;/SPAN&gt;&lt;/CODE&gt;, ArcGIS hangs and I have to force it to close with Task Manager.&lt;/P&gt;&lt;P&gt;Changing &lt;CODE&gt;plt.show()&lt;/CODE&gt; to &lt;CODE&gt;plt.show(block=False)&lt;/CODE&gt; should make the plot non-blocking, but this crashes ArcMap either, with a Runtime Error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working with Windows 7 and ArcGIS 10.1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The codes are something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;SPAN class="kwd"&gt;import&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; ConversionUtils&lt;BR /&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;SPAN class="kwd"&gt;import&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; arcpy &lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;SPAN class="kwd"&gt;from&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; arcpy &lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;import&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; env &lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;SPAN class="kwd"&gt;import&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; matplotlib&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;pyplot &lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;as&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; plt &lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln"&gt;&lt;CODE&gt;&lt;SPAN class="pln"&gt;xLabelName = ConversionUtils.gp.GetParameterAsText(0)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln"&gt;&lt;SPAN class="pln"&gt;&lt;SPAN class="pln"&gt;&lt;CODE&gt;&lt;SPAN class="pln"&gt;yLabelName = ConversionUtils.gp.GetParameterAsText(1)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln"&gt;&lt;SPAN class="pln"&gt;&lt;SPAN class="pln"&gt;&lt;SPAN class="pln"&gt;&lt;SPAN class="pln"&gt;&lt;SPAN class="pln"&gt;&lt;SPAN class="pln"&gt;&lt;CODE&gt;&lt;SPAN class="pln"&gt;&lt;SPAN class="pln"&gt;&lt;SPAN class="pln"&gt;&lt;SPAN class="pln"&gt;&lt;SPAN class="pln"&gt;Titel = ConversionUtils.gp.GetParameterAsText(2)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln"&gt;&lt;CODE&gt;&lt;SPAN class="pln"&gt;fig &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; plt&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;figure&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;()&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;plt&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;plot&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;range&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;10&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;),&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; range&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;10&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;))&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;SPAN class="pln"&gt;plt&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;xlabel&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str"&gt;xLabelName, fontsize = 14&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;SPAN class="pln"&gt;plt&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;ylabel&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str"&gt;yLabelName, fontsize = 14&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pun"&gt;&lt;CODE&gt;&lt;SPAN class="pun"&gt;plt.title(str(Titel), fontsize = 16)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;SPAN class="pln"&gt;plt&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;grid&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;SPAN class="pln"&gt;plt&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;savefig&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str"&gt;'abc.png'&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;SPAN class="pln"&gt;plt&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;show&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;()&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because &lt;SPAN class="comment-copy"&gt;matplotlib uses TKinter by default, so the window &lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;pop up &lt;/SPAN&gt;&lt;/SPAN&gt;from &lt;CODE&gt;&lt;SPAN class="pln"&gt;plt&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;show&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;()&lt;/SPAN&gt;&lt;/CODE&gt; crashes ArcGIS. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The problem has been bothering me for days. I will greatly appreciate any ideas on how can I solve this Problem.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2016 10:13:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576290#M45185</guid>
      <dc:creator>CanZhang</dc:creator>
      <dc:date>2016-01-04T10:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: matplotlib.pyplot.show() crashes ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576291#M45186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It will probably remain so, since no one can replicate the problem with only partial code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2016 10:49:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576291#M45186</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-01-04T10:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: matplotlib.pyplot.show() crashes ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576292#M45187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have c&lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;omplemented the code.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2016 11:01:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576292#M45187</guid>
      <dc:creator>CanZhang</dc:creator>
      <dc:date>2016-01-04T11:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: matplotlib.pyplot.show() crashes ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576293#M45188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So the trick is to track down the source of the error. I edited the code to simplify it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import ConversionUtils
import arcpy 
from arcpy import env 
import matplotlib.pyplot as plt
xLabelName = "x label"
yLabelName = "y_label"
title = "Title"
fig = plt.figure()
plt.plot(range(10), range(10))
plt.xlabel(xLabelName, fontsize = 14) 
plt.ylabel(yLabelName, fontsize = 14) 
plt.title(str(title), fontsize = 16)
plt.grid() 
plt.savefig("f:/test/abc.png") 
plt.show()&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically I got rid of all that conversion stuff and tried to get output as a graph (see image) and as a file (see file).&lt;/P&gt;&lt;P&gt;It works...ergo...your problem is with your inputs using that ConversionUtils stuff.&amp;nbsp; At least your have a start point.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="mpl_demo_line.png" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/164421_mpl_demo_line.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:48:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576293#M45188</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T00:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: matplotlib.pyplot.show() crashes ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576294#M45189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, as you've tried, it works also fine only with python IDLE.&lt;/P&gt;&lt;P&gt;Because I use the code as the source of a customizing tool, so I need using that ConversionUtils). The problem is : the matplotlib utilizes Tkinter in it's backend.&amp;nbsp; I've had problems running Tkinter windows from within ArcMap.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2016 11:24:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576294#M45189</guid>
      <dc:creator>CanZhang</dc:creator>
      <dc:date>2016-01-04T11:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: matplotlib.pyplot.show() crashes ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576295#M45190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, Tkinter will cause crashes,&amp;nbsp; just google " tkinter arcmap crash " for some examples. &lt;/P&gt;&lt;P&gt;There are also posts for alternatives, for example python addins&lt;/P&gt;&lt;P&gt;&lt;A href="http://gis.stackexchange.com/questions/143053/creating-tkinter-dialog-box-in-arcpy" title="http://gis.stackexchange.com/questions/143053/creating-tkinter-dialog-box-in-arcpy"&gt;python addin - Creating Tkinter dialog box in arcpy? - Geographic Information Systems Stack Exchange&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But practically, you would be better off, using a conventional or python toolbox to get your input parameters rather than reinventing the wheel in a different dialog, if you intend to use this in arcmap&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2016 11:28:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576295#M45190</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-01-04T11:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: matplotlib.pyplot.show() crashes ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576296#M45191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My input parameters are using a conventional GUI through &lt;SPAN class="pln"&gt;&lt;CODE&gt;&lt;SPAN class="pln"&gt;ConversionUtils.gp.GetParameterAsText. &lt;/SPAN&gt;&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln"&gt;&lt;SPAN class="pln"&gt;The Tkinter window is a output window, which pop up through &lt;CODE&gt;&lt;SPAN class="pln"&gt;plt&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;show&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;().&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln"&gt;&lt;SPAN class="pln"&gt;&lt;SPAN class="pun"&gt;After I run the tool/script, it shows an extra window with the plot diagram. Just like the output in IDLE.&lt;IMG alt="mpl_demo_line.png" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/164550_mpl_demo_line.png" style="height: auto;" /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln"&gt;&lt;SPAN class="pln"&gt;&lt;SPAN class="pun"&gt;Then I want to use this &lt;SPAN class="pln"&gt;&lt;SPAN class="pln"&gt;output window. After I usethe &lt;CODE class="docutils literal"&gt;&lt;SPAN class="pre"&gt;Pan/Zoom&lt;/SPAN&gt;&lt;/CODE&gt; button, then click the save button in this window, it crashes arcgis. The diagram cannot be saved with this button, but I want to...&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln"&gt;&lt;SPAN class="pln"&gt;&lt;SPAN class="pun"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2016 16:05:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576296#M45191</guid>
      <dc:creator>CanZhang</dc:creator>
      <dc:date>2016-01-04T16:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: matplotlib.pyplot.show() crashes ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576297#M45192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry...the window I showed works for me, don't know why yours doesn't.&amp;nbsp; Using Windows 10, ArcMap 10.3.1, tested in python 3.4.x and 2.7.x&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2016 16:17:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576297#M45192</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-01-04T16:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: matplotlib.pyplot.show() crashes ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576298#M45193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It doesn't work by me..I have to force it to close arcgis with Task Manager.&lt;/P&gt;&lt;P&gt;but thank you all the way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2016 16:31:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576298#M45193</guid>
      <dc:creator>CanZhang</dc:creator>
      <dc:date>2016-01-04T16:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: matplotlib.pyplot.show() crashes ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576299#M45194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you might want to try it without the ConversionUtils module and either develop your app so that arcmap doesn't need to be open&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2016 06:35:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576299#M45194</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-01-05T06:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: matplotlib.pyplot.show() crashes ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576300#M45195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I didn't see it in your code example (or in Dan' either), but you should close the plt --- include this line after the plt.show():&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;plt.close()&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See if that stops the instability you are experiencing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2016 14:50:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576300#M45195</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2016-01-05T14:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: matplotlib.pyplot.show() crashes ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576301#M45196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As an alternative, why not just let the default image viewer open the plot?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import os
import matplotlib.pyplot as plt

def plotthegraph():

&amp;nbsp;&amp;nbsp;&amp;nbsp; xLabelName = "x label" 
&amp;nbsp;&amp;nbsp;&amp;nbsp; yLabelName = "y_label" 
&amp;nbsp;&amp;nbsp;&amp;nbsp; title = "Title" 
&amp;nbsp;&amp;nbsp;&amp;nbsp; fig = plt.figure() 
&amp;nbsp;&amp;nbsp;&amp;nbsp; plt.plot(range(10), range(10)) 
&amp;nbsp;&amp;nbsp;&amp;nbsp; plt.xlabel(xLabelName, fontsize = 14) 
&amp;nbsp;&amp;nbsp;&amp;nbsp; plt.ylabel(yLabelName, fontsize = 14) 
&amp;nbsp;&amp;nbsp;&amp;nbsp; plt.title(str(title), fontsize = 16) 
&amp;nbsp;&amp;nbsp;&amp;nbsp; plt.grid() 
&amp;nbsp;&amp;nbsp;&amp;nbsp; plt.savefig(r'H:\abc.png')
&amp;nbsp;&amp;nbsp;&amp;nbsp; plt.close()
&amp;nbsp;&amp;nbsp;&amp;nbsp; os.system(r'H:\abc.png') #this should allow the installed image viewer to open the png&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:48:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576301#M45196</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-12T00:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: matplotlib.pyplot.show() crashes ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576302#M45197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;James, I think the problem he is having is that he has an extra instance of a Tkinter window opening through some means.&amp;nbsp; They don't behave with ArcMap, but I have had no problem with matplotlib figures opening ... I can even flip back and forth to the graph window and arcmap.&amp;nbsp; If you try to have other Tk dialogs open, there are "issues" which for some undocumented reasons, ArcMap doesn't behave nicely in the presence of Tkinter even though it is distributed with python.&amp;nbsp; There are work arounds, but they are akin to getting a car to move with square wheels.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2016 15:53:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576302#M45197</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-01-05T15:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: matplotlib.pyplot.show() crashes ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576303#M45198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've seen weirdness at times too.&amp;nbsp; But if you do not instantiate plt.show(), simply save the fig, close it and then just allow os.system to open it using whatever default Windows application that typically views .png files to open it should remove the instability issues because a Tkinter window is not being used.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2016 16:03:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576303#M45198</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2016-01-05T16:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: matplotlib.pyplot.show() crashes ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576304#M45199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi James, right, this is maybe an alternativ solution, so that the TK window won't show up in arcgis.&lt;/P&gt;&lt;P&gt;ps: plt.close() doesn't work, because plt.show() will &lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps alt-edited"&gt;suspend the process/script, until man close the window &lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;manual.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2016 16:10:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576304#M45199</guid>
      <dc:creator>CanZhang</dc:creator>
      <dc:date>2016-01-05T16:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: matplotlib.pyplot.show() crashes ArcGIS</title>
      <link>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576305#M45200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You definitely want to include plt.close() after you have finished with writing the plot to a file!!! Google it &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2016 16:21:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/matplotlib-pyplot-show-crashes-arcgis/m-p/576305#M45200</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2016-01-05T16:21:12Z</dc:date>
    </item>
  </channel>
</rss>

