Hi Elizabeth,<div><br></div><div>It could be that your .matplotlibrc file is specifying another backend. I think this called whenever you import matplotlib, which would be before you do "backend: Agg</div><div>"</div>
<div><br></div><div>-Andrew<br><br><div class="gmail_quote">On Mon, May 2, 2011 at 1:07 PM, Elizabeth Tasker <span dir="ltr"><<a href="mailto:taskere@mcmaster.ca">taskere@mcmaster.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
For some reason, it doesn't recognise this. Even though I have it right at the start of my script, I see:<br>
<br>
work/taskere/yt/yt-2/lib/python2.6/site-packages/matplotlib/__init__.py:854: UserWarning:  This call to matplotlib.use() has no effect<br>
because the the backend has already been chosen;<br>
matplotlib.use() must be called *before* pylab, matplotlib.pyplot,<br>
or matplotlib.backends is imported for the first time.<br>
<br>
<br>
But it couldn't come any earlier:<br>
<br>
#!/usr/bin/python<div class="im"><br>
<br>
import matplotlib<br>
matplotlib.use('Agg')<br>
<br></div><div class="im">
from yt.config import ytcfg; ytcfg["yt","serialize"] = "False"<br>
from yt.analysis_modules.api import EnzoSimulation as ES<br>
from yt.mods import *<br>
<br>
<br>
<br></div><font color="#888888">
Elizabeth</font><div><div></div><div class="h5"><br>
<br>
<br>
Cameron Hummels wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Try making the first two lines of your code:<br>
<br>
import matplotlib<br>
matplotlib.use('Agg')<br>
<br>
I believe the caps on the 'Agg' matter.<br>
<br>
Cameron<br>
<br>
On 5/2/11 11:18 AM, Elizabeth Tasker wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I suspect this is really a python query, but I've been unable to fix it... An cluster upgrade has meant I have to submit all my yt scripts to the queue, rather than running interactively. For some reason, my script wants to pull up a window to show its plot and then panics because it can't find a display when it's submitted to a node. I don't understand why it wants to do this when I ask it to save, not show:<br>

<br>
<br>
<br>
from yt.config import ytcfg; ytcfg["yt","serialize"] = "False"<br>
from yt.analysis_modules.api import EnzoSimulation as ES<br>
from yt.mods import *<br>
..<br>
..<br>
..<br>
..<br>
stuff<br>
..<br>
..<br>
..<br>
pylab.plot(time, mass)<br>
pylab.ylim([6.39e9, 6.5e9])<br>
pylab.savefig("mass_fig.png")<br>
<br>
<br>
I tried adding a "matplotlib.use('agg')" in there but to no avail.<br>
<br>
Elizabeth<br>
<br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br>
</blockquote>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</blockquote>
<br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</div></div></blockquote></div><br></div>