[Matplotlib-users] imshow and 2d interpolation

2006-12-21 Thread Paul Cristini
Hi everybody,

I am trying to perform interpolation on 2d data ( irregular or not) and 
I am wondering if there is a way to get the interpolated results which 
are obtained with the imshow command. This would allow a very complete 
interpolation command with many options. The available functions ( 
griddata, interp2d..) only provides few possibilities for the 
interpolation process.

Thanks


-- 
Paul Cristini
Chargé de recherche CNRS
UMR5212-Modélisation et Imagerie en Géosciences
Université de Pau et des Pays de l'Adour
BP 1155 -- 64013 PAU Cedex
Tel: (33) (0)5 59 40 76 27
Fax: (33) (0)5 59 40 74 15



-
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.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] IDLE, matplotlib and show command

2006-12-21 Thread Giorgio Luciano
I've searched a bit in the FAQ, since in the last days I'm struggling 
with the show and close command.
I've got a function that calculate values to plot. I calculate plot, use 
show command and everything goes fine.
I close the figure recalculate values and then replot and everything 
freezes because the show command seems still active.
I've tried to start IDLE using -n option but no solution. the plots 
freezes and I loose all calculations, and then I have to restart. reload 
etc..
I tried also to turn interactive off but no way of solving.

I'm using WIN XP
python 2.5
numpy 1.01
scipy 0.52
matplotlib 0.87.7

and I don't want to come back to matlab :) Since in matlab it's very 
common to calculate something, recalculate, plot etc. etc.

Any help would be very appreciated.
If needed I can post function and file I'm using in .tar
Giorgio



-
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.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] IDLE, matplotlib and show command

2006-12-21 Thread Darren Dale
On Thursday 21 December 2006 5:04 am, Giorgio Luciano wrote:
> I've searched a bit in the FAQ, since in the last days I'm struggling
> with the show and close command.
> I've got a function that calculate values to plot. I calculate plot, use
> show command and everything goes fine.
> I close the figure recalculate values and then replot and everything
> freezes because the show command seems still active.
> I've tried to start IDLE using -n option but no solution. the plots
> freezes and I loose all calculations, and then I have to restart. reload
> etc..
> I tried also to turn interactive off but no way of solving.
>
> I'm using WIN XP
> python 2.5
> numpy 1.01
> scipy 0.52
> matplotlib 0.87.7
>
> and I don't want to come back to matlab :) Since in matlab it's very
> common to calculate something, recalculate, plot etc. etc.

Try setting interactive : True in your matplotlibrc file, and restart your 
idle -n session. Then you shouldn't even need to use the show() command, the 
behavior will be very similar to matlab.

Darren

-
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.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] IDLE, matplotlib and show command

2006-12-21 Thread Giorgio Luciano
I've created a shortcut in the desktop to start idle-n
unsing C:\Python25\Lib\idlelib\idle.bat -n
then I changed matplotlibrc and set interactive: True
then started Idle, loaded the module and run.
At first I had this error message...

Traceback (most recent call last):
  File "C:\Python25\Lib\site-packages\prove\demo.py", line 1, in 
from pylab import *
  File "C:\Python25\lib\site-packages\pylab.py", line 1, in 
from matplotlib.pylab import *
  File "C:\Python25\lib\site-packages\matplotlib\pylab.py", line 220, in 

new_figure_manager, draw_if_interactive, show = pylab_setup()
  File "C:\Python25\lib\site-packages\matplotlib\backends\__init__.py", 
line 23, in pylab_setup
globals(),locals(),[backend_name])
  File 
"C:\Python25\lib\site-packages\matplotlib\backends\backend_wxagg.py", 
line 19, in 
import wx
ImportError: No module named wx

naturally I installed WX wxPython2.8-win32-unicode-2.8.0.1-py25

and restart the demo. plots load faster (and I needed to use show). but 
then I recalculated and restart and everything crashed again :(
I'm frustrated .. any hints :(
And sorry for bother I dont' want to get back to matlab
Giorgio


-
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.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to clean memory after plots ?

2006-12-21 Thread Sebastian Busch
Giorgio Luciano wrote:
> ... when I restart the function ... all plots freeze.

can you give an example?

In [1]: from pylab import *

In [2]: def f(x):
   ...: return 2*x
   ...:

In [8]: plot f(array(range(10)))
--> plot(f(array(range(10
Out[8]: []

In [9]: show
--> show()

In [10]: def f(x):
   : return x*x
   :

In [11]: plot f(array(range(10)))
---> plot(f(array(range(10
Out[11]: []

In [12]: show
---> show()


works here...
sebastian.


-
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.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] IDLE, matplotlib and show command

2006-12-21 Thread Giorgio Luciano
It worked 
I dont' know why , probably i dind't restart correctly after changing 
config but with the setting you suggest it went fine.
THANKS !! You SAVED my DAY !!
Giorgio



-
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.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] IDLE, matplotlib and show command

2006-12-21 Thread Darren Dale
On Thursday 21 December 2006 08:16, Giorgio Luciano wrote:
> I've created a shortcut in the desktop to start idle-n
> unsing C:\Python25\Lib\idlelib\idle.bat -n
> then I changed matplotlibrc and set interactive: True
> then started Idle, loaded the module and run.
> At first I had this error message...
>
> Traceback (most recent call last):
>   File "C:\Python25\Lib\site-packages\prove\demo.py", line 1, in 
>     from pylab import *
>   File "C:\Python25\lib\site-packages\pylab.py", line 1, in 
>     from matplotlib.pylab import *
>   File "C:\Python25\lib\site-packages\matplotlib\pylab.py", line 220, in
> 
>     new_figure_manager, draw_if_interactive, show = pylab_setup()
>   File "C:\Python25\lib\site-packages\matplotlib\backends\__init__.py",
> line 23, in pylab_setup
>     globals(),locals(),[backend_name])
>   File
> "C:\Python25\lib\site-packages\matplotlib\backends\backend_wxagg.py",
> line 19, in 
>     import wx
> ImportError: No module named wx
>
> naturally I installed WX wxPython2.8-win32-unicode-2.8.0.1-py25
>
> and restart the demo. plots load faster (and I needed to use show). but
> then I recalculated and restart and everything crashed again :(
> I'm frustrated .. any hints :(
> And sorry for bother I dont' want to get back to matlab

I see. When you use idle, you should set backend : TkAgg in your rc settings. 
The reason for this is discussed in the matplotlib users manual, see 
http://matplotlib.sourceforge.net/users_guide_0.87.7.pdf.

Darren

-
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.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imshow and 2d interpolation

2006-12-21 Thread John Hunter
> "Paul" == Paul Cristini <[EMAIL PROTECTED]> writes:

Paul> Hi everybody, I am trying to perform interpolation on 2d
Paul> data ( irregular or not) and I am wondering if there is a
Paul> way to get the interpolated results which are obtained with
Paul> the imshow command. This would allow a very complete
Paul> interpolation command with many options. The available
Paul> functions ( griddata, interp2d..) only provides few
Paul> possibilities for the interpolation process.

They are not readily exposed (but with a little work can be accessed
using the existing framework) but I could write some helper methods to
make them more easily usable. 

What are your typical use cases.  You do want to turn 2D grayscale
into interpolated 2D grayscale, or 2D->interpolated RGB[A] or RGBA ->
interpolated RGBA?

The 2nd and 3rd cases can mostly be done with the existing tools,
though some helper methods would facilitate it.

JDH

-
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.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] [newbie] show a specific figure instance

2006-12-21 Thread andrea zonca
Hi there,
I'm new to matplotlib...here is the problem, probably trivial:
I've 44 figures handles, and I want to show 1 only, how can I set
show() to display one of this instances?
if I call show() it opens all the 44 figures.

I'm using matplotlib 0.87.7 on ipython 0.7.1 under ubuntu dapper

thanks

a

-
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.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imshow and 2d interpolation

2006-12-21 Thread Jeff Whitaker
John Hunter wrote:
>> "Paul" == Paul Cristini <[EMAIL PROTECTED]> writes:
>> 
>
> Paul> Hi everybody, I am trying to perform interpolation on 2d
> Paul> data ( irregular or not) and I am wondering if there is a
> Paul> way to get the interpolated results which are obtained with
> Paul> the imshow command. This would allow a very complete
> Paul> interpolation command with many options. The available
> Paul> functions ( griddata, interp2d..) only provides few
> Paul> possibilities for the interpolation process.
>
> They are not readily exposed (but with a little work can be accessed
> using the existing framework) but I could write some helper methods to
> make them more easily usable. 
>
> What are your typical use cases.  You do want to turn 2D grayscale
> into interpolated 2D grayscale, or 2D->interpolated RGB[A] or RGBA ->
> interpolated RGBA?
>
> The 2nd and 3rd cases can mostly be done with the existing tools,
> though some helper methods would facilitate it.
>
> JDH
>   

There's also the scipy.ndimage 
(http://www.scipy.org/SciPyPackages/Ndimage - see the Interpolate section).

-Jeff

-- 
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC  R/PSD1FAX   : (303)497-6449
325 BroadwayBoulder, CO, USA 80305-3328


-
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.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Missing links on website

2006-12-21 Thread Paul Novak
I don't know if this is right place to post this, but there are several
missing links on the matplotlib website. For example, all the links from
the http://matplotlib.sourceforge.net/matplotlib.numerix.html page are
missing. Those links include
http://matplotlib.sourceforge.net/matplotlib.numerix.linear_algebra.html
http://matplotlib.sourceforge.net/matplotlib.numerix.ma.html
among others.

Thanks,
Paul


-
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.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Masked nan

2006-12-21 Thread Paul Novak

I have a problem that arose when I tried to run the gridding irregularly
spaced data demo on the wiki
http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data

When I run the attached script, which sets one value of an array to nan, 
masks the array where there are nan, and tries to plot it using 
contour(), I get the following errors:


/usr/lib/python2.4/site-packages/numpy/core/ma.py:604: UserWarning: 
Cannot automatically convert masked array to numeric because data

is masked in one or more locations.
  warnings.warn("Cannot automatically convert masked array to "\
Traceback (most recent call last):
  File "masked_nan.py", line 18, in ?
contour(x, y, z)
  File "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", line 
1754, in contour

ret =  gca().contour(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 
4092, in contour

return ContourSet(self, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line 
429, in __init__

x, y, z = self._contour_args(*args)# also sets self.levels,
  File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line 
614, in _contour_args

lev = self._autolev(z, 7)
  File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line 
517, in _autolev

zmargin = (zmax - zmin) * 0.001 # so z < (zmax + zmargin)
TypeError: unsupported operand type(s) for -: 'str' and 'str'

I am using
>>> numpy.__version__
'1.0'
>>> matplotlib.__version__
'0.87.7'

Is there a way to use contour() and plot arrays whose elements may be nan?

Thanks,
Paul
import matplotlib
import numpy
import numpy.core.ma as ma
from pylab import *

a = linspace(0, 1, 3)
b = linspace(0, 1, 3)

x, y = meshgrid(a, b)

z = x + y

z[0][0] = numpy.nan

z = ma.masked_where(numpy.isnan(z), z)
contour(x, y, z)
show()-
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.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Masked nan

2006-12-21 Thread Jeff Whitaker
Paul Novak wrote:
> I have a problem that arose when I tried to run the gridding irregularly
> spaced data demo on the wiki
> http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data
>
> When I run the attached script, which sets one value of an array to 
> nan, masks the array where there are nan, and tries to plot it using 
> contour(), I get the following errors:
>
> /usr/lib/python2.4/site-packages/numpy/core/ma.py:604: UserWarning: 
> Cannot automatically convert masked array to numeric because data
> is masked in one or more locations.
>   warnings.warn("Cannot automatically convert masked array to "\
> Traceback (most recent call last):
>   File "masked_nan.py", line 18, in ?
> contour(x, y, z)
>   File "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", line 
> 1754, in contour
> ret =  gca().contour(*args, **kwargs)
>   File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 
> 4092, in contour
> return ContourSet(self, *args, **kwargs)
>   File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line 
> 429, in __init__
> x, y, z = self._contour_args(*args)# also sets self.levels,
>   File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line 
> 614, in _contour_args
> lev = self._autolev(z, 7)
>   File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line 
> 517, in _autolev
> zmargin = (zmax - zmin) * 0.001 # so z < (zmax + zmargin)
> TypeError: unsupported operand type(s) for -: 'str' and 'str'
>
> I am using
> >>> numpy.__version__
> '1.0'
> >>> matplotlib.__version__
> '0.87.7'
>
> Is there a way to use contour() and plot arrays whose elements may be 
> nan?
>
> Thanks,
> Paul

Paul:  Your test script works for me (numpy 1.0, matplotlib 0.87.7, 
python2.5 on macos x).

-Jeff

-- 
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC  R/PSD1FAX   : (303)497-6449
325 BroadwayBoulder, CO, USA 80305-3328


-
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.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Masked nan

2006-12-21 Thread Darren Dale
On Thursday 21 December 2006 13:43, Jeff Whitaker wrote:
> Paul Novak wrote:
> > I have a problem that arose when I tried to run the gridding irregularly
> > spaced data demo on the wiki
> > http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data
> >
> > When I run the attached script, which sets one value of an array to
> > nan, masks the array where there are nan, and tries to plot it using
> > contour(), I get the following errors:
> >
> > /usr/lib/python2.4/site-packages/numpy/core/ma.py:604: UserWarning:
> > Cannot automatically convert masked array to numeric because data
> > is masked in one or more locations.
> >   warnings.warn("Cannot automatically convert masked array to "\
> > Traceback (most recent call last):
> >   File "masked_nan.py", line 18, in ?
> > contour(x, y, z)
> >   File "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", line
> > 1754, in contour
> > ret =  gca().contour(*args, **kwargs)
> >   File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line
> > 4092, in contour
> > return ContourSet(self, *args, **kwargs)
> >   File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line
> > 429, in __init__
> > x, y, z = self._contour_args(*args)# also sets self.levels,
> >   File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line
> > 614, in _contour_args
> > lev = self._autolev(z, 7)
> >   File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line
> > 517, in _autolev
> > zmargin = (zmax - zmin) * 0.001 # so z < (zmax + zmargin)
> > TypeError: unsupported operand type(s) for -: 'str' and 'str'
> >
> > I am using
> >
> > >>> numpy.__version__
> >
> > '1.0'
> >
> > >>> matplotlib.__version__
> >
> > '0.87.7'
> >
> > Is there a way to use contour() and plot arrays whose elements may be
> > nan?
> >
> > Thanks,
> > Paul
>
> Paul:  Your test script works for me (numpy 1.0, matplotlib 0.87.7,
> python2.5 on macos x).

It worked fine for me too. Do you happen to have numerix : Numeric in your 
matplotlibrc file?

Darren

-
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.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Masked nan

2006-12-21 Thread Paul Novak
Adding the line numeric: numpy to my matplotlibrc file fixed the problem.

Thanks,
Paul

Darren Dale wrote:
> On Thursday 21 December 2006 13:43, Jeff Whitaker wrote:
>> Paul Novak wrote:
>>> I have a problem that arose when I tried to run the gridding irregularly
>>> spaced data demo on the wiki
>>> http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data
>>>
>>> When I run the attached script, which sets one value of an array to
>>> nan, masks the array where there are nan, and tries to plot it using
>>> contour(), I get the following errors:
>>>
>>> /usr/lib/python2.4/site-packages/numpy/core/ma.py:604: UserWarning:
>>> Cannot automatically convert masked array to numeric because data
>>> is masked in one or more locations.
>>>   warnings.warn("Cannot automatically convert masked array to "\
>>> Traceback (most recent call last):
>>>   File "masked_nan.py", line 18, in ?
>>> contour(x, y, z)
>>>   File "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", line
>>> 1754, in contour
>>> ret =  gca().contour(*args, **kwargs)
>>>   File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line
>>> 4092, in contour
>>> return ContourSet(self, *args, **kwargs)
>>>   File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line
>>> 429, in __init__
>>> x, y, z = self._contour_args(*args)# also sets self.levels,
>>>   File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line
>>> 614, in _contour_args
>>> lev = self._autolev(z, 7)
>>>   File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line
>>> 517, in _autolev
>>> zmargin = (zmax - zmin) * 0.001 # so z < (zmax + zmargin)
>>> TypeError: unsupported operand type(s) for -: 'str' and 'str'
>>>
>>> I am using
>>>
>> numpy.__version__
>>> '1.0'
>>>
>> matplotlib.__version__
>>> '0.87.7'
>>>
>>> Is there a way to use contour() and plot arrays whose elements may be
>>> nan?
>>>
>>> Thanks,
>>> Paul
>> Paul:  Your test script works for me (numpy 1.0, matplotlib 0.87.7,
>> python2.5 on macos x).
> 
> It worked fine for me too. Do you happen to have numerix : Numeric in your 
> matplotlibrc file?
> 
> Darren
> 
> -
> 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.php&p=sourceforge&CID=DEVDEV
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 

-
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.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] problems doing MULTIPLE plots -> old plots appear on new plots!?!

2006-12-21 Thread chris
Help! I'm trying to make multiple plots in a web app and old plots seem to
stick around and show up on new plots!??!

Is there someway to "erase the canvas" or avoid this happening?

Sound familiar?

growth function below is the first plot that is ok.
management function below is the one that has growth plot in it.

Chris

=

import matplotlib
matplotlib.use("Agg")
import pylab

BACKGROUND_COLOR = "#ff"

def growth(company):
"""
Plots Growth plot.
"""

# Generates figure_, plot_ and functions.

figure_  = pylab.figure()
plot_= pylab.subplot(111, axisbg=BACKGROUND_COLOR)
years_plus_5 = company.years + range(max(company.years) + 1,
 max(company.years) + 6)
five_percent = [1.05 ** (y - min(company.years))
   for y in years_plus_5]
ten_percent  = [1.10 ** (y - min(company.years))
   for y in years_plus_5]
fifteen_percent  = [1.15 ** (y - min(company.years))
   for y in years_plus_5]
twenty_percent   = [1.20 ** (y - min(company.years))
   for y in years_plus_5]
twenty_five_percent  = [1.25 ** (y - min(company.years))
   for y in years_plus_5]
thirty_percent   = [1.30 ** (y - min(company.years))
   for y in years_plus_5]
scaled_sales = [50.0 * e / company.sales[-1]
for e in company.sales]
scaled_earnings  = [30.0 * e / company.earnings[-1]
for e in company.earnings]
scaled_pretax_profit = [10.0 * e / company.pretax_profit[-1]
for e in company.pretax_profit]
scaled_low_price = [100.0 * e / company.high_price[-1]
for e in company.low_price]
scaled_high_price= [100.0 * e / company.high_price[-1]
for e in company.high_price]
functions = plot_.semilogy(company.years, scaled_sales,
   company.years, scaled_earnings,
   company.years, scaled_pretax_profit,
   years_plus_5,  five_percent,
   years_plus_5,  ten_percent,
   years_plus_5,  fifteen_percent,
   years_plus_5,  twenty_percent,
   years_plus_5,  twenty_five_percent,
   years_plus_5,  thirty_percent)

# Adds price bars and sets their thickness.

offset = 0.12
for i, y in enumerate(company.years):
plot_.semilogy((y, y),
   (scaled_low_price[i], scaled_high_price[i]),
   linewidth="2.2", color = "black", zorder = 1)
plot_.semilogy((y - offset, y + offset),
   (scaled_low_price[i], scaled_low_price[i]),
   linewidth="2.2", color = "black", zorder = 1)
plot_.semilogy((y - offset, y + offset),
   (scaled_high_price[i], scaled_high_price[i]),
   linewidth="2.2", color = "black", zorder = 1)

# Adds sales, earnings and pretax_profit points.

points = []
points.append(pylab.scatter(company.years, scaled_sales, 200,
  c = BACKGROUND_COLOR))
points.append(pylab.scatter(company.years, scaled_earnings,  200,
  c = BACKGROUND_COLOR))
points.append(pylab.scatter(company.years, scaled_pretax_profit, 200,
  c = BACKGROUND_COLOR))

# Configures points.

pylab.setp(points[0], linewidth = "1.3", edgecolor = "g", zorder = 12)
pylab.setp(points[1], linewidth = "1.3", edgecolor = "b", zorder = 11)
pylab.setp(points[2], linewidth = "1.3", edgecolor = "r", zorder = 10)

# Configures earnings, sales and pretax_profit.

pylab.setp(functions[0], linewidth = "3.0", color = "g", zorder = 9)
pylab.setp(functions[1], linewidth = "3.0", color = "b", zorder = 8)
pylab.setp(functions[2], linewidth = "3.0", color = "r", zorder = 7)

# Configures percentage growth.

for f in functions[-6:]:
pylab.setp(f, linewidth = "0.5", color = "k", zorder = 5)

# Configures grid.

plot_.grid(True)
grid_ = plot_.get_xgridlines() + plot_.get_ygridlines()
pylab.setp(grid_, linestyle = "-", color = "k", linewidth = "0.5",
   zorder = 5)
plot_.set_axisbelow(True)

# Sets view range f

[Matplotlib-users] subplot problem with (altervista) debian package

2006-12-21 Thread Thierry Dumont
I have a problem on my debian stable installation.

I use the packages of altervista:
deb http://anakonda.altervista.org/debian packages/
deb-src http://anakonda.altervista.org/debian sources/

subplot is ok with the syntax subplot(212) for example, but not with
subplot(2,1,2) (and I need this syntax).

In the second case, all the plots appears at the same place.
To see this, simply change the subblot commands in zorder_demo.py for
example.

With an Ubuntu installation (6.10) (in this case matplotlib is packaged
in the distribution), it seems ok.

any solution?

t.d.
-- 

Thierry Dumont. Institut Camille Jordan -- Mathematiques--
Univ. Lyon I,43 Bd du 11 Novembre 1918, 69622
 - Villeurbanne Cedex - France.
[EMAIL PROTECTED]  web: http://math.univ-lyon1.fr/~tdumont

begin:vcard
fn:Thierry Dumont
n:Dumont;Thierry
org;quoted-printable:CNRS - Universit=C3=A9 Lyon 1.;Institut Camille Jordan
adr:;;43 Bd du 11 Novembre;Villeurbanne Cedex;F;69621;France
email;internet:[EMAIL PROTECTED]
title;quoted-printable:Ing=C3=A9nieur de Recherche/Research Ingeneer
x-mozilla-html:FALSE
url:http://math.univ-lyon1.fr/~tdumont
version:2.1
end:vcard

-
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.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users