rlp_GMC wrote:
> When I try to save a fig to a file I get the error
>
> TclError Couldn't Connect to display ":0.0"
>
> I looked in the Maplotlib users manual (latest version pg 144-146) and
> tried the following with no luck. BTW why is the same module named
> differently Linux/Win ?
>
I presume you have different versions installed on each OS. pyplot was
added only recently.
> import matplotlib
> matplotlib.use('Agg')
> import matplotlib.pylab as plt (linux ) or, import matplotlib.pyplot as
> plt (Windows)
> fig = plt.figure()
> ax = fig.add_subplot(111)
> ax.plot([1,2,3])
> fig.savefig('test.png')
>
> Is Matplotlib trying to display a plot to the monitor?
>
If TkAgg is set as your backend, then, yes, it will try to open a window
on the display. If you need to run on a remote headless server, for
instance, you can use the Agg backend. I see that you are doing that
(with the matplotlib.use('Agg')) line, so I'm surprised why any
Tcl-related message would be displayed at all.
Can you provide the information described here:
http://matplotlib.sourceforge.net/faq/troubleshooting_faq.html#reporting-problems
Cheers,
Mike
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users