SCIENTIFIC-LINUX-USERS Archives

August 2012

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Orion Poplawski <[log in to unmask]>
Reply To:
Orion Poplawski <[log in to unmask]>
Date:
Thu, 30 Aug 2012 12:13:16 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (57 lines)
On 08/30/2012 12:44 AM, Luo Li wrote:
> Hi,lists!
>
> My host is:
> Linux localhost.localdomain 2.6.32-220.23.1.el6.i686 #1 SMP Mon Jun 18
> 09:58:35 CDT 2012 i686 i686 i386 GNU/Linux
>
> And I'm using the matplotlib version is:
>
> python-matplotlib-0.99.1.2-1.el6.i686
>
> I copy the code form pyplot tutorial on page 13,the link is
> http://matplotlib.sf.net/Matplotlib.pdf
> Here is the code named pyPlot.py in my directory:
>
> import numpy as np
> import matplotlib.pyplot as plt
> def f(t):
>          return np.exp(-t) * np.cos(2*np.pi*t)
> t1 = np.arange(0.0, 5.0, 0.1)
> t2 = np.arange(0.0, 5.0, 0.02)
> plt.figure(1)
> plt.subplot(211)
> plt.plot(t1, f(t1), 'bo', t2, f(t2), 'k')
> plt.subplot(212)
> plt.plot(t2, np.cos(2*np.pi*t2),'r--')
>

You're missing a plt.show() at the end.

> Using the python is:
>
> [root@localhost ~]# python
> Python 2.6.6 (r266:84292, Jun 18 2012, 09:59:14)
> [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
>
> When I run the file:
> [root@localhost ~]# python pyPlot.py
> Xlib:  extension "RANDR" missing on display "localhost:10.0".
> /usr/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py:621:
> DeprecationWarning: Use the new widget gtk.Tooltip
>    self.tooltips = gtk.Tooltips()
>
> It did not show any figure, I googling the whole internet,found it could be a
> bug in Fedora 12 ,https://bugzilla.redhat.com/show_bug.cgi?id=596649
> But it fixed , I don't konw whether it is a bug in Scientific Linux 6.2
> because I could not find any information on the internet.

If you don't like the warning, you could clone the bug to RHEL6.

-- 
Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA, Boulder Office                  FAX: 303-415-9702
3380 Mitchell Lane                       [log in to unmask]
Boulder, CO 80301                   http://www.nwra.com

ATOM RSS1 RSS2