<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi, <div>this is weird, and I know it has worked a couple of days ago. I am puzzled and not sure what to check anymore.</div><div>I am running the MacPorts Python installation</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>which python </div><div>in terminal gives</div><div><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-style-span" style="white-space: pre;">/opt/local/bin/python</span></div><span class="Apple-style-span" style="white-space: pre;"> </span><div><span class="Apple-style-span" style="white-space: pre;">In Textmate, I have the following Shell Variables set:</span></div><div><span class="Apple-style-span" style="white-space: pre;">TM_PYTHON = /opt/local/bin/python</span></div><div><span class="Apple-style-span" style="white-space: pre;">PYTHONPATH = /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages</span></div><div><span class="Apple-style-span" style="white-space: pre;"><br></span></div><div><span class="Apple-style-span" style="white-space: pre;">When I run the script shown below from terminal using</span></div><div><span class="Apple-style-span" style="white-space: pre;">python testscript.py</span></div><div><span class="Apple-style-span" style="white-space: pre;">the matplotlib window pops up, and all is good. </span></div><div><span class="Apple-style-span" style="white-space: pre;">When I run the script from within TextMate using cmd-R the script runs fine unitl just before the plt.figure() line. Then in the dock the "python rocket" symbol launches, but no Matplotlib window pops open, no error message, just the bouncing python rocket.</span></div><div><span class="Apple-style-span" style="white-space: pre;"><br></span></div><div><span class="Apple-style-span" style="white-space: pre;">I tried changing backends in the matplotlibrc, but only "MacOSX" results in no error message, which is what I have previously used.</span></div><div><span class="Apple-style-span" style="white-space: pre;"><br></span></div><div><span class="Apple-style-span" style="white-space: pre;">What could the reason be why matplotlib doesn't work anymore from within TextMate?</span></div><div><span class="Apple-style-span" style="white-space: pre;"><br></span></div><div><span class="Apple-style-span" style="white-space: pre;">Thanks for your help!</span></div><div><span class="Apple-style-span" style="white-space: pre; ">Cheers,</span></div><div><span class="Apple-style-span" style="white-space: pre;"><font face="Helvetica" size="3" class="f1">Claus</font>
</span><div><div><br></div><div><br></div><div><br></div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">import matplotlib.pyplot as plt</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">import numpy as np</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">import scipy.special as sps</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "># create x-array</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">t = np.arange(-3.0, 3.0, 0.01)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "># create y-array</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">x = sps.erf(t)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "># print x-array vs. y-array</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">fig = plt.figure()</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">ax = fig.add_subplot(111)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">ax.plot(t, x)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">plt.show()</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "># printx-array and. y-array, just to see something</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">print t</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">print x</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">print "done! Yay!"</div></div></div></div></body></html>