[Matplotlib-users] GTk backend problem

2010-08-09 Thread Antonino Cucchiara

Hello,
I recently upgraded to Enthought python 2.6 an so I have now matplotlib 
0.99.3
My scripts now no longer seem to find the pyGTK since when I run them I 
got this message:


Traceback (most recent call last):
  File ./sed_plotb_v2.py, line 14, in module
from pylab import *
  File 
/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/pylab.py, 
line 1, in module

from matplotlib.pylab import *
  File 
/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/matplotlib/pylab.py, 
line 247, in module

from matplotlib.pyplot import *
  File 
/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/matplotlib/pyplot.py, 
line 78, in module

new_figure_manager, draw_if_interactive, show = pylab_setup()
  File 
/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/matplotlib/backends/__init__.py, 
line 25, in pylab_setup

globals(),locals(),[backend_name])
  File 
/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/matplotlib/backends/backend_gtkagg.py, 
line 10, in module
from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, 
FigureCanvasGTK,\
  File 
/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py, 
line 11, in module

raise ImportError(Gtk* backend requires pygtk to be installed.)
ImportError: Gtk* backend requires pygtk to be installed.


is any way to help matplotlib to point the where pyGTK is or go around 
the problem with another backend?


Thanks,
Nino Hello,
I recently upgraded to Enthought python 2.6 an so I have now matplotlib 
0.99.3
My scripts now no longer seem to find the pyGTK since when I run them I 
got this message:


Traceback (most recent call last):
  File ./sed_plotb_v2.py, line 14, in module
from pylab import *
  File 
/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/pylab.py, 
line 1, in module

from matplotlib.pylab import *
  File 
/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/matplotlib/pylab.py, 
line 247, in module

from matplotlib.pyplot import *
  File 
/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/matplotlib/pyplot.py, 
line 78, in module

new_figure_manager, draw_if_interactive, show = pylab_setup()
  File 
/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/matplotlib/backends/__init__.py, 
line 25, in pylab_setup

globals(),locals(),[backend_name])
  File 
/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/matplotlib/backends/backend_gtkagg.py, 
line 10, in module
from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, 
FigureCanvasGTK,\
  File 
/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py, 
line 11, in module

raise ImportError(Gtk* backend requires pygtk to be installed.)
ImportError: Gtk* backend requires pygtk to be installed.


is any way to help matplotlib to point the where pyGTK is or go around 
the problem with another backend?

Changing the matplotlibrc to TKAgg works fine though.

Thanks,
Nino

--

Antonino Cucchiara, PhD
Postdoctoral Scholar
Lawrence Berkeley National Lab
UC Berkeley
website: www.astro.psu.edu/~cucchiara/

--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev ___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] GTK backend problem

2007-03-16 Thread liujiaping

Hi, all. I have a problem when using matpltlib and pygtk. When I draw a very
very long line in a figure, the line cannot be drawn as it should be. For
example, consider the codes below:

-Beginning of codes--
#!/usr/bin/env python
import gtk

from matplotlib.figure import Figure
from matplotlib.lines import Line2D

from matplotlib.backends.backend_gtkagg import FigureCanvasGTK as
FigureCanvas
from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTK as
NavigationToolbar
# Uncomment the two lines below to use GTKAgg as a different backend
#from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as
FigureCanvas
#from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTKAgg \
#   as
NavigationToolbar

win = gtk.Window()
win.connect(destroy, lambda x: gtk.main_quit())
win.set_default_size(400,300)
win.set_title(Embedding in GTK)
vbox = gtk.VBox()
win.add(vbox)

fig = Figure()
ax = fig.add_subplot(111)
ax.grid(True)
ax.set_autoscale_on(False)
ax.set_xlim(0, 2)
ax.set_ylim(-2, 2)
ax.plot([1, 1, 2,2], [-1, 1, 1, 0])

canvas = FigureCanvas(fig)
vbox.pack_start(canvas)
toolbar = NavigationToolbar(canvas, win)
vbox.pack_start(toolbar, False, False)
win.show_all()
gtk.main()

-End of codes--
You might think that it will show a line like this:

+...
   |
   A
very very long line 
   |
   |
   |
   |
But the result is like this:
...--+
  Also a very very long line  ...  |

|

|

|

You can view the picture here:
http://ljiaping.googlepages.com/embedding_in_gtk1.jpg

And if you use the zoom button in the navigation toolbar to zoom out this
image, the horizontal line will change its direction to right. You can view
the picture here:
http://ljiaping.googlepages.com/embedding_in_gtk2.jpg

But if you use GTKAgg as matplotlib's backend the figure shows properly.
Here is the source code file
embedding_in_gtk.pyhttp://ljiaping.googlepages.com/embedding_in_gtk.py,
you can try it yourself.

I have tried to read the source codes of the library to know the reason, but
I have not enough knowledge of image processing and I failed.
Any help is appreciated. Thank you.
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users