[Matplotlib-users] Using PIL in the Linux!

2008-03-26 Thread sa6113

I want to use PIL in order to load from string to Image , but there is a
problem , I can use PIL only in Windows platform whiles I want to use it in
Linux and another Platforms.
What should I do ?
-- 
View this message in context: 
http://www.nabble.com/Using-PIL-in-the-Linux%21-tp16296324p16296324.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Using PIL in the Linux!

2008-03-26 Thread Eric Firing
sa6113 wrote:
 I want to use PIL in order to load from string to Image , but there is a
 problem , I can use PIL only in Windows platform whiles I want to use it in
 Linux and another Platforms.
 What should I do ?

No problem.  Chances are, your distro has it as a package.  In ubuntu it 
is python-imaging.  Alternatively, you can build from source.  See the 
first download entry here: http://www.pythonware.com/products/pil/.

Eric


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Controlling the wxpython matplotlib-frame

2008-03-26 Thread Wolfgang Kerzendorf
Hello all,
I have trouble with one of my scripts that uses matplotlib when using  
python or ipython. The first time it opens, it does not hand the  
control back o the shell and can be used to work on the matplotlib  
figure interactively (I use an event handler and picker objects to  
change my plots) so it works really well. After I close the window the  
control is given back to the shell. This is how I want it to work,  
however at the second time the matplotlib plot opens the shell does  
not stop anymore, the script continues. When I used GTKAgg on my old  
linux box I had the same issue and bound a key to  
pylab.get_current_figure_manager().destroy(), which looked like a hack  
to me but  worked. This does not work anymore with wxPython, because  
the next time I open a plot I get an exception:

PyDeadObjectError: The C++ part of the FigureFrameWxAgg object has  
been deleted, attribute access no longer allowed.

I also think destroying the figure_manager is not the right way to do  
that. Whats a goog solution for this?
Thanks in advance
 Wolfgang

P.S.: I know I posted a similar thing yesterday, but I thought  
rephrasing the question might help with finding the solution

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] load data from string or array to Image

2008-03-26 Thread sa6113


I have a problem to load data from string or array to Image but without
using PIL , because I have to check the application in 6 different platforms
like Windows 32bit, Windows X64 (64bit version), Linux 32bit, Linux 64bit
x86_64, Linux IPF (Itanium Processor Family) and HP-UX 64.

There is a code but I don't want to use PIL :
http://mail.python.org/pipermail/image-sig/1998-October/000572.html

Can I accomplish the same thing using the modules that are already on the
system, or those that are pure Python (not requiring any compilation or
binary download)?

-- 
View this message in context: 
http://www.nabble.com/load-data-from-string-or-array-to-Image-tp16297653p16297653.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] windrose OO

2008-03-26 Thread Lionel Roubeyrie
Hi all,
find with this message a modified version of windrose to be OO compliant. 
It uses inheritance from PolarAxes to create a WindroseAxes, with 4 methods 
(contour, contourf, bar and box). BTW it's now possible to control it like 
any other axes, with the limitation of subploting (subplot is to closer to 
simple axe and polaraxe). There's also a extra argument 'blowto' which 
reverse the plot (used in pollutantrose), and scipy is not required (just 
numpy).
Hope someone find it usefull
Cordialy
-- 
Lionel Roubeyrie - [EMAIL PROTECTED]
Chargé d'études et de maintenance
LIMAIR - la Surveillance de l'Air en Limousin
http://www.limair.asso.fr


windrose_oo.py
Description: application/python
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Loading and saving arbitrary objects with attributes

2008-03-26 Thread Troels Kofoed Jacobsen
Hi.

Does anyone know how to save and load an arbitrary object (e.g a numpy
array) to a file, and load it again?

I cannot use savetxt and loadtxt as these only stores the numbers.  I
think I'm looking for some binary format.

Best regards / Med Venlig Hilsen
Troels Kofoed Jacobsen

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Loading and saving arbitrary objects with attributes

2008-03-26 Thread Pierre GM
On Wednesday 26 March 2008 07:16:37 Troels Kofoed Jacobsen wrote:
 Hi.

 Does anyone know how to save and load an arbitrary object (e.g a numpy
 array) to a file, and load it again?

Have you tried to pickle your object w/ cPickle ?

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problems in Inkscape with SVG exported from matplotlib

2008-03-26 Thread Michael Droettboom
When matplotlib outputs an SVG, each unique character is assigned a 
numeric id (these are just assigned in order), and inserted as a def, 
and then used (referenced) wherever they are used.

When you paste on SVG into another, those names clash, and Inkscape is 
pulling in the wrong characters when it goes to draw.

Now, my gut feels that this is actually a bug in Inkscape -- pasting of 
referenced objects from one file into another should reassign new ids.  
However, I'm not an SVG expert, so I could be wrong, but I think I will 
take this question over to the Inkscape mailing list anyway.

That said, there are probably some workarounds that matplotlib could 
make (using a hash of the character's content as the id, for instance).  
I'll look into that and reply when progress has been made.

Mike

Kaushik Ghose wrote:
 Hi Everyone,

 I have a peculiar problem, and I wonder if anyone can assist me.

 I have two figures generated from matplotlib and saved as svgs. They 
 both print fine, and they load in Inkscape just fine.

 However, when I copy one figure and paste it into the other, the pasted 
 figure's labels and text become garbled.

 Screenshots on this page
 http://assorted-experience.blogspot.com/2008/03/inkscape-matplotlibs-svg-one-strange.html


 Any suggestions would be most welcome
 Thanks
 -Kaushik

 -
 Check out the new SourceForge.net Marketplace.
 It's the best place to buy or sell services for
 just about anything Open Source.
 http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
   

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] easy way to find and install all dependencies for Ubuntu source install

2008-03-26 Thread Ryan Krauss
I need to help a friend install from source on Ubuntu Gutsy.  What is
the easiest way to determine all dependencies and make sure he has all
the right dev packages?  I suspect we want to install the WXAgg,
GTKAgg, TkAGG, and postscript backends.

Thanks,

Ryan

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problems in Inkscape with SVG exported from matplotlib

2008-03-26 Thread Peter I. Hansen
On Tue, Mar 25, 2008 at 11:33 PM, Kaushik Ghose [EMAIL PROTECTED] wrote:
 Hi Everyone,

  I have a peculiar problem, and I wonder if anyone can assist me.

  I have two figures generated from matplotlib and saved as svgs. They
  both print fine, and they load in Inkscape just fine.

  However, when I copy one figure and paste it into the other, the pasted
  figure's labels and text become garbled.

A trick that works for me is to produce eps files with matplotlib,
import them in scribus, and then export them to svg. Then they seem to
be nicely compatible with inkscape.

-Peter

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problems in Inkscape with SVG exported from matplotlib

2008-03-26 Thread Michael Droettboom
I didn't write the first pass of SVG support, that was done before I got 
involved -- I'm not sure who to credit, but he or she deserves most of it.

I did add the feature that's causing grief here -- the embedding of 
character outlines directly in the SVG file.

I've committed a change in SVN (both the trunk and the branch) that 
should resolve your problem.  I've written the inkscape mailing list 
about the correct solution, but I figure we need a workaround in mpl 
regardless.

If you're not tracking SVN, you can replace your copy of backend_svg.py 
with this one, and it should *probably* work:

http://matplotlib.svn.sourceforge.net/viewvc/*checkout*/matplotlib/branches/v0_91_maint/lib/matplotlib/backends/backend_svg.py?revision=5023pathrev=5023

Cheers,
Mike

Kaushik Ghose wrote:
 Hi Mike,

 Ah, such prompt, friendly and knowledgeable help!

 You're the guy implementing svg support in matplotlib, right? Thanks 
 so much for implementing this!!!
 If I can do anything to assist please tell me.

 Thanks again,
 -Kaushik

 Michael Droettboom wrote:
 When matplotlib outputs an SVG, each unique character is assigned a 
 numeric id (these are just assigned in order), and inserted as a 
 def, and then used (referenced) wherever they are used.

 When you paste on SVG into another, those names clash, and Inkscape 
 is pulling in the wrong characters when it goes to draw.

 Now, my gut feels that this is actually a bug in Inkscape -- pasting 
 of referenced objects from one file into another should reassign new 
 ids.  However, I'm not an SVG expert, so I could be wrong, but I 
 think I will take this question over to the Inkscape mailing list 
 anyway.

 That said, there are probably some workarounds that matplotlib could 
 make (using a hash of the character's content as the id, for 
 instance).  I'll look into that and reply when progress has been made.

 Mike

 Kaushik Ghose wrote:
 Hi Everyone,

 I have a peculiar problem, and I wonder if anyone can assist me.

 I have two figures generated from matplotlib and saved as svgs. They 
 both print fine, and they load in Inkscape just fine.

 However, when I copy one figure and paste it into the other, the 
 pasted figure's labels and text become garbled.

 Screenshots on this page
 http://assorted-experience.blogspot.com/2008/03/inkscape-matplotlibs-svg-one-strange.html
  



 Any suggestions would be most welcome
 Thanks
 -Kaushik

 - 

 Check out the new SourceForge.net Marketplace.
 It's the best place to buy or sell services for
 just about anything Open Source.
 http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
  

 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
   


-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problems in Inkscape with SVG exported from matplotlib

2008-03-26 Thread Michael Droettboom
Peter I. Hansen wrote:
 On Tue, Mar 25, 2008 at 11:33 PM, Kaushik Ghose [EMAIL PROTECTED] wrote:
   
 Hi Everyone,

  I have a peculiar problem, and I wonder if anyone can assist me.

  I have two figures generated from matplotlib and saved as svgs. They
  both print fine, and they load in Inkscape just fine.

  However, when I copy one figure and paste it into the other, the pasted
  figure's labels and text become garbled.
 

 A trick that works for me is to produce eps files with matplotlib,
 import them in scribus, and then export them to svg. Then they seem to
 be nicely compatible with inkscape.
   
I wonder if you could skip a step and just use the Cairo backend to 
output SVG?  Does that not work?  It should be quite similar.

Mike

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] draw_tex NotImplementedError in backend_bases.py

2008-03-26 Thread Ryan Krauss
I think I have correctly installed from source.  I checked the
dependencies for USETEX and have the right versions for dvipng, gs,
latex, and pdftops.  When trying to plot with text.usetex=True I get

type 'exceptions.NotImplementedError'   Traceback (most recent call last)

/home/william/svn/matplotlib/ipython console in module()

/usr/lib/python2.5/site-packages/matplotlib/pyplot.py in plot(*args, **kwargs)
   1827 try:
   1828 ret =  gca().plot(*args, **kwargs)
- 1829 draw_if_interactive()
   1830 except:
   1831 hold(b)

/usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py in
draw_if_interactive()
   1164 figManager = Gcf.get_active()
   1165 if figManager is not None:
- 1166 figManager.canvas.draw()
   1167
   1168

/usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py in
draw(self, repaint)
886 DEBUG_MSG(draw(), 1, self)
887 self.renderer = RendererWx(self.bitmap, self.figure.dpi)
-- 888 self.figure.draw(self.renderer)
889 if repaint:
890 self.gui_repaint()

/usr/lib/python2.5/site-packages/matplotlib/figure.py in draw(self, renderer)
774
775 # render the axes
-- 776 for a in self.axes: a.draw(renderer)
777
778 # render the figure text

/usr/lib/python2.5/site-packages/matplotlib/axes.py in draw(self,
renderer, inframe)
   1399
   1400 for zorder, i, a in dsu:
- 1401 a.draw(renderer)
   1402
   1403 renderer.close_group('axes')

/usr/lib/python2.5/site-packages/matplotlib/axis.py in draw(self,
renderer, *args, **kwargs)
678 tick.set_label1(label)
679 tick.set_label2(label)
-- 680 tick.draw(renderer)
681 if tick.label1On and tick.label1.get_visible():
682 extent = tick.label1.get_window_extent(renderer)

/usr/lib/python2.5/site-packages/matplotlib/axis.py in draw(self, renderer)
177
178 if self.label1On:
-- 179 self.label1.draw(renderer)
180 if self.label2On:
181 self.label2.draw(renderer)

/usr/lib/python2.5/site-packages/matplotlib/text.py in draw(self, renderer)
759 def draw(self, renderer):
760 self.update_coords(renderer)
-- 761 Text.draw(self, renderer)
762 if self.get_dashlength()  0.0:
763 self.dashline.draw(renderer)

/usr/lib/python2.5/site-packages/matplotlib/text.py in draw(self, renderer)
307
308 renderer.draw_tex(gc, x, y, line,
-- 309   self._fontproperties, angle)
310 return
311

/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py in
draw_tex(self, gc, x, y, s, prop, angle, ismath)
264
265 def draw_tex(self, gc, x, y, s, prop, angle, ismath='TeX!'):
-- 266 raise NotImplementedError
267
268 def draw_text(self, gc, x, y, s, prop, angle, ismath=False):

type 'exceptions.NotImplementedError':

In [4]: 
---
type 'exceptions.NotImplementedError'   Traceback (most recent call last)

/usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py in
_onPaint(self, evt)
   1018 self.realize()
   1019 # Render to the bitmap
- 1020 self.draw(repaint=False)
   1021 # Update the display using a PaintDC
   1022 self.gui_repaint(drawDC=wx.PaintDC(self))

/usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py in
draw(self, repaint)
886 DEBUG_MSG(draw(), 1, self)
887 self.renderer = RendererWx(self.bitmap, self.figure.dpi)
-- 888 self.figure.draw(self.renderer)
889 if repaint:
890 self.gui_repaint()

/usr/lib/python2.5/site-packages/matplotlib/figure.py in draw(self, renderer)
774
775 # render the axes
-- 776 for a in self.axes: a.draw(renderer)
777
778 # render the figure text

/usr/lib/python2.5/site-packages/matplotlib/axes.py in draw(self,
renderer, inframe)
   1399
   1400 for zorder, i, a in dsu:
- 1401 a.draw(renderer)
   1402
   1403 renderer.close_group('axes')

/usr/lib/python2.5/site-packages/matplotlib/axis.py in draw(self,
renderer, *args, **kwargs)
678 tick.set_label1(label)
679 tick.set_label2(label)
-- 680 tick.draw(renderer)
681 if tick.label1On and tick.label1.get_visible():
682 extent = tick.label1.get_window_extent(renderer)

/usr/lib/python2.5/site-packages/matplotlib/axis.py in draw(self, renderer)
177
178 if self.label1On:
-- 179 self.label1.draw(renderer)
180 if self.label2On:
181 self.label2.draw(renderer)

/usr/lib/python2.5/site-packages/matplotlib/text.py in draw(self, 

Re: [Matplotlib-users] easy way to find and install all dependencies for Ubuntu source install

2008-03-26 Thread Ryan Krauss
Thanks Darren.  I think we got this right, but I started a new thread
with a usetex problem after we installed.  I don't know if this is
really a build problem or some other bug.  Maybe it should be the same
thread.

Ryan

On 3/26/08, Darren Dale [EMAIL PROTECTED] wrote:
 On Wednesday 26 March 2008 10:15:13 am Ryan Krauss wrote:
   I need to help a friend install from source on Ubuntu Gutsy.  What is
   the easiest way to determine all dependencies and make sure he has all
   the right dev packages?  I suspect we want to install the WXAgg,
   GTKAgg, TkAGG, and postscript backends.


 You could just try running python setup.py build. That will test for all the
  required and optional libraries and generate a report at the beginning of the
  process. Be mindful of missing headers or devel libraries.


  Darren


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] draw_tex NotImplementedError in backend_bases.py

2008-03-26 Thread Michael Droettboom
It looks like you're trying to use the Wx backend, where usetex is not 
supported.

See here for a matrix of which features are supported with each backend:

http://matplotlib.sourceforge.net/backends.html

Set the backend setting in your matplotlibrc file or call 
matplotlib.use at the top of your script.

Cheers,
Mike

Ryan Krauss wrote:
 I think I have correctly installed from source.  I checked the
 dependencies for USETEX and have the right versions for dvipng, gs,
 latex, and pdftops.  When trying to plot with text.usetex=True I get

 type 'exceptions.NotImplementedError'   Traceback (most recent call last)

 /home/william/svn/matplotlib/ipython console in module()

 /usr/lib/python2.5/site-packages/matplotlib/pyplot.py in plot(*args, **kwargs)
1827 try:
1828 ret =  gca().plot(*args, **kwargs)
 - 1829 draw_if_interactive()
1830 except:
1831 hold(b)

 /usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py in
 draw_if_interactive()
1164 figManager = Gcf.get_active()
1165 if figManager is not None:
 - 1166 figManager.canvas.draw()
1167
1168

 /usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py in
 draw(self, repaint)
 886 DEBUG_MSG(draw(), 1, self)
 887 self.renderer = RendererWx(self.bitmap, self.figure.dpi)
 -- 888 self.figure.draw(self.renderer)
 889 if repaint:
 890 self.gui_repaint()

 /usr/lib/python2.5/site-packages/matplotlib/figure.py in draw(self, renderer)
 774
 775 # render the axes
 -- 776 for a in self.axes: a.draw(renderer)
 777
 778 # render the figure text

 /usr/lib/python2.5/site-packages/matplotlib/axes.py in draw(self,
 renderer, inframe)
1399
1400 for zorder, i, a in dsu:
 - 1401 a.draw(renderer)
1402
1403 renderer.close_group('axes')

 /usr/lib/python2.5/site-packages/matplotlib/axis.py in draw(self,
 renderer, *args, **kwargs)
 678 tick.set_label1(label)
 679 tick.set_label2(label)
 -- 680 tick.draw(renderer)
 681 if tick.label1On and tick.label1.get_visible():
 682 extent = tick.label1.get_window_extent(renderer)

 /usr/lib/python2.5/site-packages/matplotlib/axis.py in draw(self, renderer)
 177
 178 if self.label1On:
 -- 179 self.label1.draw(renderer)
 180 if self.label2On:
 181 self.label2.draw(renderer)

 /usr/lib/python2.5/site-packages/matplotlib/text.py in draw(self, renderer)
 759 def draw(self, renderer):
 760 self.update_coords(renderer)
 -- 761 Text.draw(self, renderer)
 762 if self.get_dashlength()  0.0:
 763 self.dashline.draw(renderer)

 /usr/lib/python2.5/site-packages/matplotlib/text.py in draw(self, renderer)
 307
 308 renderer.draw_tex(gc, x, y, line,
 -- 309   self._fontproperties, angle)
 310 return
 311

 /usr/lib/python2.5/site-packages/matplotlib/backend_bases.py in
 draw_tex(self, gc, x, y, s, prop, angle, ismath)
 264
 265 def draw_tex(self, gc, x, y, s, prop, angle, ismath='TeX!'):
 -- 266 raise NotImplementedError
 267
 268 def draw_text(self, gc, x, y, s, prop, angle, ismath=False):

 type 'exceptions.NotImplementedError':

 In [4]: 
 ---
 type 'exceptions.NotImplementedError'   Traceback (most recent call last)

 /usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py in
 _onPaint(self, evt)
1018 self.realize()
1019 # Render to the bitmap
 - 1020 self.draw(repaint=False)
1021 # Update the display using a PaintDC
1022 self.gui_repaint(drawDC=wx.PaintDC(self))

 /usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py in
 draw(self, repaint)
 886 DEBUG_MSG(draw(), 1, self)
 887 self.renderer = RendererWx(self.bitmap, self.figure.dpi)
 -- 888 self.figure.draw(self.renderer)
 889 if repaint:
 890 self.gui_repaint()

 /usr/lib/python2.5/site-packages/matplotlib/figure.py in draw(self, renderer)
 774
 775 # render the axes
 -- 776 for a in self.axes: a.draw(renderer)
 777
 778 # render the figure text

 /usr/lib/python2.5/site-packages/matplotlib/axes.py in draw(self,
 renderer, inframe)
1399
1400 for zorder, i, a in dsu:
 - 1401 a.draw(renderer)
1402
1403 renderer.close_group('axes')

 /usr/lib/python2.5/site-packages/matplotlib/axis.py in draw(self,
 renderer, *args, **kwargs)
 678 tick.set_label1(label)
 679 tick.set_label2(label)
 -- 680 tick.draw(renderer)
 681  

Re: [Matplotlib-users] draw_tex NotImplementedError in backend_bases.py

2008-03-26 Thread Darren Dale
On Wednesday 26 March 2008 11:20:46 am Ryan Krauss wrote:
 I think I have correctly installed from source.  I checked the
 dependencies for USETEX and have the right versions for dvipng, gs,
 latex, and pdftops.  When trying to plot with text.usetex=True I get
[...]
 Does this mean we really didn't successfully build from source? Or is
 there some other problem?

I think it means you need to use the wxagg backend rather than wx. Is that a 
possibility?

Darren

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problems in Inkscape with SVG exported from matplotlib

2008-03-26 Thread Michael Droettboom
For the sake of the list, I'm linking the response to my question on the 
Inkscape mailing list -- this is certainly an Inkscape bug, that their 
copy-and-paste functionality does not handle use/defs correctly.

However, as the workaround in mpl was easy enough, we don't have to wait 
for Inkscape to fix what sounds like a difficult problem.

http://sourceforge.net/mailarchive/forum.php?thread_name=3c78ff030803260851l36e71d12n173fb77d4ddc4579%40mail.gmail.comforum_name=inkscape-devel

Cheers,
Mike

Kaushik Ghose wrote:
 Hi Mike,

 I replaced the current file with your modified one, and it works fine 
 - I pasted three figures together and had not problems. (I am on 
 Windows XP, Python 2.5)

 Thanks again for maintaining and enhancing matplotlib!
 -Kaushik

 Michael Droettboom wrote:
 I didn't write the first pass of SVG support, that was done before I 
 got involved -- I'm not sure who to credit, but he or she deserves 
 most of it.

 I did add the feature that's causing grief here -- the embedding of 
 character outlines directly in the SVG file.

 I've committed a change in SVN (both the trunk and the branch) that 
 should resolve your problem.  I've written the inkscape mailing list 
 about the correct solution, but I figure we need a workaround in 
 mpl regardless.

 If you're not tracking SVN, you can replace your copy of 
 backend_svg.py with this one, and it should *probably* work:

 http://matplotlib.svn.sourceforge.net/viewvc/*checkout*/matplotlib/branches/v0_91_maint/lib/matplotlib/backends/backend_svg.py?revision=5023pathrev=5023
  


 Cheers,
 Mike

 Kaushik Ghose wrote:
 Hi Mike,

 Ah, such prompt, friendly and knowledgeable help!

 You're the guy implementing svg support in matplotlib, right? Thanks 
 so much for implementing this!!!
 If I can do anything to assist please tell me.

 Thanks again,
 -Kaushik

 Michael Droettboom wrote:
 When matplotlib outputs an SVG, each unique character is assigned a 
 numeric id (these are just assigned in order), and inserted as a 
 def, and then used (referenced) wherever they are used.

 When you paste on SVG into another, those names clash, and Inkscape 
 is pulling in the wrong characters when it goes to draw.

 Now, my gut feels that this is actually a bug in Inkscape -- 
 pasting of referenced objects from one file into another should 
 reassign new ids.  However, I'm not an SVG expert, so I could be 
 wrong, but I think I will take this question over to the Inkscape 
 mailing list anyway.

 That said, there are probably some workarounds that matplotlib 
 could make (using a hash of the character's content as the id, for 
 instance).  I'll look into that and reply when progress has been made.

 Mike

 Kaushik Ghose wrote:
 Hi Everyone,

 I have a peculiar problem, and I wonder if anyone can assist me.

 I have two figures generated from matplotlib and saved as svgs. 
 They both print fine, and they load in Inkscape just fine.

 However, when I copy one figure and paste it into the other, the 
 pasted figure's labels and text become garbled.

 Screenshots on this page
 http://assorted-experience.blogspot.com/2008/03/inkscape-matplotlibs-svg-one-strange.html
  



 Any suggestions would be most welcome
 Thanks
 -Kaushik

 - 

 Check out the new SourceForge.net Marketplace.
 It's the best place to buy or sell services for
 just about anything Open Source.
 http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
  

 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
   



-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [newbie] live plots of multiple lines

2008-03-26 Thread Chris Withers

Matthias Michler wrote:

My x-axis is time, and as new points are plotted, even though I'm
following the above recipe pretty closely, the x-tick spacing isn't
getting sorted out, so I end up with just a jumble as the tick labels
for the x-axis. Do you know why this might be?


I'm not sure I understand correctly, but if the number of xticks increases 
dramatically (nobody could see the individual ticks), 


Indeed, it looks like the Tick spacing is staying as it was when the 
first point was plotted, so when hundreds more points are plotted, I 
just get a jumble of labels on the x-axis.


the above script leads 
to a different behaviour on my system.


What is that behaviour and what version of matplotlib are you using?


Shame I get that horrible exception when I do close the plot window,
wish I knew how to make it stop :-S


I don't know which exception you refer to, but sometimes if gives problems if 
the interactive mode wasn't switched off (ioff()) before the scripts ends 
or show() is called.


If I run the attached script, and hit Ctrl-C in the DOS box running it, 
I get:


C:\python mpltest.py
Traceback (most recent call last):
  File mpltest.py, line 3, in module
show()
  File 
C:\Python25\Lib\site-packages\matplotlib\backends\backend_tkagg.py, li

e 76, in show
Tk.mainloop()
  File C:\Python25\lib\lib-tk\Tkinter.py, line 328, in mainloop
_default_root.tk.mainloop(n)
KeyboardInterrupt
Fatal Python error: PyEval_RestoreThread: NULL tstate

This application has requested the Runtime to terminate it in an unusual 
way.

Please contact the application's support team for more information.

I've had a similar error when I hit the red cross in the corner of the 
window with other scripts, although not this one :-S


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
from pylab import *
plot([1,2],[3,4])
show()
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] capturing arrow key events

2008-03-26 Thread Alexandre Zabot
Hi,

Tim Leslie reported a bug in GTK/GTKAgg backends concerning the down arrow
key.
You can read his message here:
http://sourceforge.net/mailarchive/message.php?msg_id=20050413093244.GA4688%40cse.unsw.edu.auhttp://sourceforge.net/mailarchive/message.php?msg_id=20050413093244.GA4688%2540cse.unsw.edu.au

I'm sending a very simple example which reproduces the problem.
Just run it and try to type:
left arrow
down arrow

here is my output:
[EMAIL PROTECTED] python ex.py
key_press_event  left   0.159 0.195
key_release_eventleft   0.159 0.195
key_press_event  down   0.159 0.195
Traceback (most recent call last):
  File ex.py, line 14, in module
show()
  File
/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py, line
71, in show
gtk.main()
KeyboardInterrupt


As you can see, there's no key_release_event for down arrow. I have to quit
the script with ctrl+C.
Same thing happens with GTK but not with TKAgg, for example.

Does anyone have an idea for fixing this problem?

System: Kutuntu 7.10
Python: 2.5.1
Matplotlib: 0.91.2


-- 
Até,
Alexandre Zabot


event.tar.bz2
Description: BZip2 compressed data
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] unicode filenames and MPL.

2008-03-26 Thread Christopher Barker
Hi all,

I'm writing a little MPL embedded in wxPython app, and just ran into this:

Traceback (most recent call last):
...
...
/matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg/matplotlib/backends/backend_agg.py,
 

line 397, in print_png
 self.get_renderer()._renderer.write_png(filename, 
self.figure.dpi.get())
TypeError: cannot return std::string from Unicode object

As soon as I saw it, I knew what happened: I'm running the unicode 
version of wxPython, so the filename I got back from a SaveFile Dialog 
is in unicode. Now, it's easy enough for me to turn that into a string 
for now, but as more and more file systems are implemented in unicode, 
it might be nice if we could use unicode file names with MPL.

Are there any plans along these lines? Or are we just going to have to 
wait for py3k?

-CHB

-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/ORR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] saving a PNg jsut as dispalyed

2008-03-26 Thread Christopher Barker
Hi all,

I want to save a figure just like it is displayed i.e. the same dpi 
(wxAgg). However, the default Figure.savefig uses a different dpi 
setting than the figure as displayed, so I'm doing:

dpi = Fig.get_dpi()
Fig.savefig(str(path), dpi=dpi)

which seems to work, but seems more awkward than it should be. Is there 
a flag or something I'm missing?

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/ORR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Fwd: load data from string or array to Image

2008-03-26 Thread Anthony Floyd
Forgot to reply-to-list...

-- Forwarded message --
From: Anthony Floyd [EMAIL PROTECTED]
Date: Wed, Mar 26, 2008 at 4:54 PM
Subject: Re: [Matplotlib-users] load data from string or array to Image
To: sa6113 [EMAIL PROTECTED]


On Wed, Mar 26, 2008 at 1:33 AM, sa6113 [EMAIL PROTECTED] wrote:
 
 
   I have a problem to load data from string or array to Image but without
   using PIL , because I have to check the application in 6 different platforms
   like Windows 32bit, Windows X64 (64bit version), Linux 32bit, Linux 64bit
   x86_64, Linux IPF (Itanium Processor Family) and HP-UX 64.
 
   There is a code but I don't want to use PIL :
   http://mail.python.org/pipermail/image-sig/1998-October/000572.html
 
   Can I accomplish the same thing using the modules that are already on the
   system, or those that are pure Python (not requiring any compilation or
   binary download)?

 I went through this just a few weeks ago.  Now, mind you I'm using wx
 and numpy already.

 My solution was to turn my .png into a Python string using img2py.py
 in the wx/tools directory.

 With the string, I then used the following code to return the image (a
 watermark) as an array that figimage() or imshow() can use directly.
 I'm sure the code can be optimized, but it works fast enough for me...

 def getWatermarkArray():
rows = 28
columns = 200
dimensions = 3

image = getWatermarkImage()
# image array is a string of hex values
imageString = image.GetData()

imageList = [ord(item) for item in imageString]

imageArray = numpy.zeros(shape=(28,200,3), dtype=numpy.float32)

imageCounter = 0

for rowCounter in range(rows):
for columnCounter in range(columns):
for dimCounter in range(dimensions):
imageArray[rowCounter][columnCounter][dimCounter] =
 imageList[imageCounter]/255.
imageCounter += 1

return imageArray

 HTH,
 A

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] saving a PNg jsut as dispalyed

2008-03-26 Thread Ryan Krauss
I think this line in the rc file is the trick

#savefig.dpi   : 100

On Wed, Mar 26, 2008 at 6:16 PM, Christopher Barker
[EMAIL PROTECTED] wrote:
 Hi all,

  I want to save a figure just like it is displayed i.e. the same dpi
  (wxAgg). However, the default Figure.savefig uses a different dpi
  setting than the figure as displayed, so I'm doing:

  dpi = Fig.get_dpi()
  Fig.savefig(str(path), dpi=dpi)

  which seems to work, but seems more awkward than it should be. Is there
  a flag or something I'm missing?

  -Chris



  --
  Christopher Barker, Ph.D.
  Oceanographer

  Emergency Response Division
  NOAA/NOS/ORR(206) 526-6959   voice
  7600 Sand Point Way NE   (206) 526-6329   fax
  Seattle, WA  98115   (206) 526-6317   main reception

  [EMAIL PROTECTED]

  -
  Check out the new SourceForge.net Marketplace.
  It's the best place to buy or sell services for
  just about anything Open Source.
  http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] windrose OO

2008-03-26 Thread Alan G Isaac
On Wed, 26 Mar 2008, Lionel Roubeyrie apparently wrote:
 [Attachment: windrose_oo.py : APPLICATION/X-PYTHON, 28502 bytes] 

Thanks for the update.

Cheers,
Alan Isaac




-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Fwd: load data from string or array to Image

2008-03-26 Thread sa6113

I use matplotlib and Backend Agg to draw a plot , I want to show this plot in
my GUI in specific area (Plot area) , I need to have the image object in
oder to show it, so I have to convert this plot to string or array or save
in buffer and then load it to an Image , I want to know , can I accomplish
this without using PIL , because I need to build, test and verify any new
package added to the system on 6 different platforms, and it might take a
long time and at high expertise level to add the module to our entire
system.

What I have to do?
I can convert it to string or array with numpy or FigureCanvas or ect. , my
problem is how to load this array or string to image !
Is it clear?
 

Anthony Floyd-2 wrote:
 
 Forgot to reply-to-list...
 
 -- Forwarded message --
 From: Anthony Floyd [EMAIL PROTECTED]
 Date: Wed, Mar 26, 2008 at 4:54 PM
 Subject: Re: [Matplotlib-users] load data from string or array to Image
 To: sa6113 [EMAIL PROTECTED]
 
 
 On Wed, Mar 26, 2008 at 1:33 AM, sa6113 [EMAIL PROTECTED] wrote:
  
  
I have a problem to load data from string or array to Image but
 without
using PIL , because I have to check the application in 6 different
 platforms
like Windows 32bit, Windows X64 (64bit version), Linux 32bit, Linux
 64bit
x86_64, Linux IPF (Itanium Processor Family) and HP-UX 64.
  
There is a code but I don't want to use PIL :
http://mail.python.org/pipermail/image-sig/1998-October/000572.html
  
Can I accomplish the same thing using the modules that are already on
 the
system, or those that are pure Python (not requiring any compilation
 or
binary download)?
 
  I went through this just a few weeks ago.  Now, mind you I'm using wx
  and numpy already.
 
  My solution was to turn my .png into a Python string using img2py.py
  in the wx/tools directory.
 
  With the string, I then used the following code to return the image (a
  watermark) as an array that figimage() or imshow() can use directly.
  I'm sure the code can be optimized, but it works fast enough for me...
 
  def getWatermarkArray():
 rows = 28
 columns = 200
 dimensions = 3
 
 image = getWatermarkImage()
 # image array is a string of hex values
 imageString = image.GetData()
 
 imageList = [ord(item) for item in imageString]
 
 imageArray = numpy.zeros(shape=(28,200,3), dtype=numpy.float32)
 
 imageCounter = 0
 
 for rowCounter in range(rows):
 for columnCounter in range(columns):
 for dimCounter in range(dimensions):
 imageArray[rowCounter][columnCounter][dimCounter] =
  imageList[imageCounter]/255.
 imageCounter += 1
 
 return imageArray
 
  HTH,
  A
 
 -
 Check out the new SourceForge.net Marketplace.
 It's the best place to buy or sell services for
 just about anything Open Source.
 http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
 

-- 
View this message in context: 
http://www.nabble.com/load-data-from-string-or-array-to-Image-tp16297653p16322508.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users