[Matplotlib-users] plotting using an image as background

2011-07-15 Thread robert
Hi there,
I am all new to mathlib world..

What I try to do is plotting some charts over an image.
I would be very grateful, if somebody could provide me with an example.
thanks
robert

--
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] speeding-up griddata()

2009-07-13 Thread Robert Cimrman

Hi all,

I would like to use griddata() to interpolate a function given at 
specified points of a bunch of other points. While the method works 
well, it slows down considerably as the number of points to interpolate 
to increases.


The dependence of time/(number of points) is nonlinear (see the 
attachment) - it seems that while the Delaunay trinagulation itself is 
fast, I wonder how to speed-up the interpolation. The docstring says, 
that it is based on "natural neighbor interpolation" - how are the 
neighbors searched? Does it use the kd-trees like scipy.spatial? I have 
a very good experience with scipy.spatial performance.


Also, is there a way of reusing the triangulation when interpolating 
several times using the same grid?


cheers,
r.

ps: no natgrid
In [9]: mpl.__version__
Out[9]: '0.98.5.3'
<>--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] speeding-up griddata()

2009-07-14 Thread Robert Kern
On 2009-07-13 13:20, Robert Cimrman wrote:
> Hi all,
>
> I would like to use griddata() to interpolate a function given at
> specified points of a bunch of other points. While the method works
> well, it slows down considerably as the number of points to interpolate
> to increases.
>
> The dependence of time/(number of points) is nonlinear (see the
> attachment) - it seems that while the Delaunay trinagulation itself is
> fast, I wonder how to speed-up the interpolation. The docstring says,
> that it is based on "natural neighbor interpolation" - how are the
> neighbors searched?

Using the Delaunay triangulation. The "natural neighbors" of an interpolation 
point are those points participating in triangles in the Delaunay triangulation 
whose circumcircles include the interpolation point. The triangle that encloses 
the interpolation point is found by a standard walking procedure, then the 
neighboring triangles (natural or otherwise) are explored in a breadth-first 
search around the starting triangle to find the natural neighbors.

Unfortunately, griddata() uses the unstructured-interpolation-points API rather 
than the more efficient grid-interpolation-points API. In the former, each 
interpolation point uses the last-found enclosing triangle as the start of the 
walking search. This works well where adjacent interpolation points are close 
to 
each other. This is not the case at the ends of the grid rows. The latter API 
is 
smarter and starts a new row of the grid with the triangle from the triangle 
from the *start* of the previous row rather than the end. I suspect this is 
largely the cause of the poor performance.

> Does it use the kd-trees like scipy.spatial? I have
> a very good experience with scipy.spatial performance.
>
> Also, is there a way of reusing the triangulation when interpolating
> several times using the same grid?

One would construct a Triangulation() object with the (x,y) data points, get a 
new NNInterpolator() object using the .nn_interpolator(z) method for each new z 
data set, and then interpolate your grid on the NNInterpolator.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] speeding-up griddata()

2009-07-14 Thread Robert Cimrman
Robert Kern wrote:
> On 2009-07-13 13:20, Robert Cimrman wrote:
>> Hi all,
>>
>> I would like to use griddata() to interpolate a function given at
>> specified points of a bunch of other points. While the method works
>> well, it slows down considerably as the number of points to interpolate
>> to increases.
>>
>> The dependence of time/(number of points) is nonlinear (see the
>> attachment) - it seems that while the Delaunay trinagulation itself is
>> fast, I wonder how to speed-up the interpolation. The docstring says,
>> that it is based on "natural neighbor interpolation" - how are the
>> neighbors searched?
> 
> Using the Delaunay triangulation. The "natural neighbors" of an interpolation 
> point are those points participating in triangles in the Delaunay 
> triangulation 
> whose circumcircles include the interpolation point. The triangle that 
> encloses 
> the interpolation point is found by a standard walking procedure, then the 
> neighboring triangles (natural or otherwise) are explored in a breadth-first 
> search around the starting triangle to find the natural neighbors.

I see, thanks for the explanation. The walking procedure is what is 
described e.g. in [1], right? (summary; starting from a random triangle, 
a line is made connecting that triangle with the interpolation point, 
and triangles along that line are probed.)

[1] http://www.geom.uiuc.edu/software/cglist/GeomDir/ptloc96.ps.gz

> Unfortunately, griddata() uses the unstructured-interpolation-points API 
> rather 
> than the more efficient grid-interpolation-points API. In the former, each 
> interpolation point uses the last-found enclosing triangle as the start of 
> the 
> walking search. This works well where adjacent interpolation points are close 
> to 
> each other. This is not the case at the ends of the grid rows. The latter API 
> is 
> smarter and starts a new row of the grid with the triangle from the triangle 
> from the *start* of the previous row rather than the end. I suspect this is 
> largely the cause of the poor performance.

Good to know, I will try to pass the points in groups of close points.

>> Does it use the kd-trees like scipy.spatial? I have
>> a very good experience with scipy.spatial performance.
>>
>> Also, is there a way of reusing the triangulation when interpolating
>> several times using the same grid?
> 
> One would construct a Triangulation() object with the (x,y) data points, get 
> a 
> new NNInterpolator() object using the .nn_interpolator(z) method for each new 
> z 
> data set, and then interpolate your grid on the NNInterpolator.

So if the above fails, I can bypass griddata() by using the delaunay 
module directly, good.

thank you,
r.


--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] speeding-up griddata()

2009-07-14 Thread Robert Kern
On 2009-07-14 12:52, Robert Cimrman wrote:
> Robert Kern wrote:
>> On 2009-07-13 13:20, Robert Cimrman wrote:
>>> Hi all,
>>>
>>> I would like to use griddata() to interpolate a function given at
>>> specified points of a bunch of other points. While the method works
>>> well, it slows down considerably as the number of points to interpolate
>>> to increases.
>>>
>>> The dependence of time/(number of points) is nonlinear (see the
>>> attachment) - it seems that while the Delaunay trinagulation itself is
>>> fast, I wonder how to speed-up the interpolation. The docstring says,
>>> that it is based on "natural neighbor interpolation" - how are the
>>> neighbors searched?
>> Using the Delaunay triangulation. The "natural neighbors" of an interpolation
>> point are those points participating in triangles in the Delaunay 
>> triangulation
>> whose circumcircles include the interpolation point. The triangle that 
>> encloses
>> the interpolation point is found by a standard walking procedure, then the
>> neighboring triangles (natural or otherwise) are explored in a breadth-first
>> search around the starting triangle to find the natural neighbors.
>
> I see, thanks for the explanation. The walking procedure is what is
> described e.g. in [1], right? (summary; starting from a random triangle,
> a line is made connecting that triangle with the interpolation point,
> and triangles along that line are probed.)
>
> [1] http://www.geom.uiuc.edu/software/cglist/GeomDir/ptloc96.ps.gz

Yes.

>>> Does it use the kd-trees like scipy.spatial? I have
>>> a very good experience with scipy.spatial performance.
>>>
>>> Also, is there a way of reusing the triangulation when interpolating
>>> several times using the same grid?
>> One would construct a Triangulation() object with the (x,y) data points, get 
>> a
>> new NNInterpolator() object using the .nn_interpolator(z) method for each 
>> new z
>> data set, and then interpolate your grid on the NNInterpolator.
>
> So if the above fails, I can bypass griddata() by using the delaunay
> module directly, good.

Yes. griddata is a fairly light wrapper that exists mainly to sanitize inputs 
and allow use of the natgrid implementation easily.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] invisible plot

2009-07-15 Thread Robert Kern
On 2009-07-15 16:58, Dr. Phillip M. Feldman wrote:
> I'm a newbie to matplotlib.  When I try to generate a simple plot, nothing
> happens.  Any advice will be appreciated.  Here's my code:
>
> from numpy import *
> from matplotlib import *
>
> x= arange(0,10.,0.1)
> y= x**1.5 - 0.25*x**2
>
> pyplot.figure(figsize=(9, 6), dpi=120)
> pyplot.plot(x, y)

pyplot.show()

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ipython --pylab without namespace pollution?

2009-07-22 Thread Robert Kern
On 2009-07-22 18:09, Christopher Barker wrote:
> Hi folks,
>
> Does anyone know if there is a way to use ipython with the advantages of
> the -pylab option (separate gui thread, etc.), but without the whole
> pylab namespace getting sucked in?
>
> I love ipython pylab mode, but like to use namespaces to keep things clean.

ipython -wthread

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


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


Re: [Matplotlib-users] incorrect boxplot?

2009-09-14 Thread Robert Kern
On 2009-09-14 13:49 PM, Gökhan Sever wrote:
>
>
> On Mon, Sep 14, 2009 at 12:30 PM,  <mailto:jason-s...@creativetrax.com>> wrote:
>
> I tried the following (most output text is deleted):
>
> In [1]: ob1=[1,1,2,2,1,2,4,3,2,2,2,3,4,5,6,7,8,9,7,6,4,5,5]
> In [2]: import matplotlib.pyplot as
> plt
> In [3]:
> plt.figure()
> In [4]:
> plt.boxplot(ob1)
> In [5]:
> plt.savefig('test.png')
> In [6]: import
> scipy.stats
> In [7]:
> scipy.stats.scoreatpercentile(ob1,75)
> Out[7]: 5.5
>
>
> Note that the 75th percentile is 5.5.  R agrees with this calculation.
> However, in the boxplot, the top of the box is around 6, not 5.5.  Isn't
> the top of the box supposed to be at the 75th percentile?
>
> Thanks,
>
> Jason
>
> --
> Jason Grout
>
>
> From  matplotlib/lib/matplotlib/axes.py
>
> You can see how matplotlib calculating percentiles. And yes it doesn't
> conform with scipy's scoreatpercentile()
>
>
>  # get median and quartiles
>  q1, med, q3 = mlab.prctile(d,[25,50,75])
>
> I[36]: q1
> O[36]: 2.0
>
> I[37]: med
> O[37]: 4.0
>
> I[38]: q3
> O[38]: 6.0
>
>
> Could this be due to a rounding? I don't know, but I am curious to hear
> the explanations for this discrepancy.

prctile does not handle the case where the exact percentile lies between two 
items. scoreatpercentile does.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] incorrect boxplot?

2009-09-14 Thread Robert Kern
On 2009-09-14 16:08 PM, Gökhan Sever wrote:
>
>
> On Mon, Sep 14, 2009 at 3:45 PM,  <mailto:jason-s...@creativetrax.com>> wrote:
>
> Robert Kern wrote:
>  > prctile does not handle the case where the exact percentile lies
> between two
>  > items. scoreatpercentile does.
>  >
>  >
>
> If mlab is supposed to be compatible with matlab, then isn't this a
> problem?
>
>   From matlab, version 7.2.0.283 (R2006a)
>
>  >> prctile([1 1 2 2 1 2 4 3 2 2 2 3 4 5 6 7 8 9 7 6 4 5 5],[0 25 50 75
> 100])
>
> ans =
>
> 1.2.4.5.75009.
>
>
> Of course, the 75th percentile is different here too (5.75 instead of
> scipy's 5.5).  I don't know how to explain that discrepancy.
>
> Jason
>
>
> Now there are 3 different 75 percentiles :). Any ideas, which is one the
> most correct?

They are all reasonable. There are lots of different ways of handling this 
case. 
 From the R documentation:

http://sekhon.berkeley.edu/stats/html/quantile.html

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] contribution offer: griddata with gaussian average

2009-10-04 Thread Robert Kern
On 2009-10-04 15:27 PM, Christopher Barker wrote:
> Václav Šmilauer wrote:
>
>> about a year ago I developed for my own purposes a routine for averaging
>> irregularly-sampled data using gaussian average.
>
> is this similar to Kernel Density estimation?
>
> http://www.scipy.org/doc/api_docs/SciPy.stats.kde.gaussian_kde.html

No. It is probably closer to radial basis function interpolation (in fact, it 
almost certainly is a form of RBFs):

http://docs.scipy.org/doc/scipy/reference/tutorial/interpolate.html#id1

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] contribution offer: griddata with gaussian average

2009-10-04 Thread Robert Kern
Ryan May wrote:
> On Sun, Oct 4, 2009 at 4:21 PM, Robert Kern  wrote:
>> On 2009-10-04 15:27 PM, Christopher Barker wrote:
>>> Václav Šmilauer wrote:
>>>
>>>> about a year ago I developed for my own purposes a routine for averaging
>>>> irregularly-sampled data using gaussian average.
>>> is this similar to Kernel Density estimation?
>>>
>>> http://www.scipy.org/doc/api_docs/SciPy.stats.kde.gaussian_kde.html
>> No. It is probably closer to radial basis function interpolation (in fact, it
>> almost certainly is a form of RBFs):
>>
>> http://docs.scipy.org/doc/scipy/reference/tutorial/interpolate.html#id1
> 
> Except in radial basis function interpolation, you solve for the
> weights that give the original values at the original data points.
> Here, it's just a inverse-distance weighted average, where the weights
> are chosen using an exp(-x^2/A) relation.  There's a huge difference
> between the two when you're dealing with data with noise.

Fair point.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] contribution offer: griddata with gaussian average

2009-10-05 Thread Robert Kern
On 2009-10-05 15:54 PM, VáclavŠmilauer wrote:

> I am not sure if that is the same as what scipy.stats.kde.gaussian_kde does,
> the documentation is terse. Can I be enlightened here?

gaussian_kde does kernel density estimation. While many of the intermediate 
computations are similar, they have entirely different purposes.

http://en.wikipedia.org/wiki/Kernel_density_estimation

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Images and memory management

2009-10-11 Thread Robert Kern
Leo Trottier wrote:
> Hi Michael,
> 
> I suppose I'm a bit confused --  I thought that jpeglib, part of which
> is implemented by PIL (??)

Other way around. PIL uses jpeglib to read JPEG files.

> could process compressed images without
> representing decompressing them to a dense raster-image matrix
> (http://en.wikipedia.org/wiki/Jpeglib).

However, PIL does not use make use of such capabilities. It just reads in the 
data into uncompressed memory just like it does with any other image format.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ImportError: No module named ma

2009-10-12 Thread Robert Kern
On 2009-10-12 11:58 AM, Chaitanya Krishna wrote:
> Hi all,
>
> I am on Mac OS 10.5 and numpy 1.3.0 and matplotlib 0.91.1.
>
> When I run a qtdemo script, it fails with
> File 
> "/Library/Python/2.5/site-packages/matplotlib-0.91.1-py2.5-macosx-10.5-i386.egg/matplotlib/numerix/ma/__init__.py",
> line 16, in
>  from numpy.core.ma import *
> ImportError: No module named ma
>
> Any ideas? I have a mixed up system where I have installed my own
> version of Python 2.6 and Apple's version at 2.5. Presently I am using
> Apple's version of Python.

Apple's version of Python comes with numpy 1.0.1, before numpy.core.ma was 
introduced. It seems like your installation of numpy 1.3.0 did not override 
Apple's version.

To double-check:

 >>> import numpy
 >>> print numpy.__file__

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ImportError: No module named ma

2009-10-12 Thread Robert Kern
On 2009-10-12 12:19 PM, Chaitanya Krishna wrote:
> Hi all,
>
> numpy.__file__ gives 1.3.0
>
>>>> import numpy
>>>> print numpy.__file__
> /Library/Python/2.5/site-packages/numpy-1.3.0-py2.5-macosx-10.5-i386.egg/numpy/__init__.pyc

Ah, right. I'm sorry. numpy.core.ma is not the location of that subpackage 
anymore. It is now numpy.ma. Upgrade to a more recent matplotlib.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ImportError: No module named ma

2009-10-12 Thread Robert Kern
On 2009-10-12 15:16 PM, Chaitanya Krishna wrote:
> Hi,
>
> I solved it by installing matplotlib 0.99. But, on Mac 10.5 when I
> used easy_install matplotlib, it was still saying that 0.91 was the
> latest and I couldn't install it. Finally I had to download the egg
> and manually install it (easy_install --install-dir)

I suspect that that version of easy_install has not been fixed to parse 
Sourceforge's new download pages.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ImportError: No module named ma

2009-10-12 Thread Robert Kern
BTW, please do not Cc: me. I am subscribed to the list and read through GMane. 
It's annoying to get list replies to my email where I don't want them.

On 2009-10-12 15:38 PM, John Hunter wrote:
> On Mon, Oct 12, 2009 at 3:21 PM, Robert Kern  wrote:
>> On 2009-10-12 15:16 PM, Chaitanya Krishna wrote:
>>> Hi,
>>>
>>> I solved it by installing matplotlib 0.99. But, on Mac 10.5 when I
>>> used easy_install matplotlib, it was still saying that 0.91 was the
>>> latest and I couldn't install it. Finally I had to download the egg
>>> and manually install it (easy_install --install-dir)
>>
>> I suspect that that version of easy_install has not been fixed to parse
>> Sourceforge's new download pages.
>
> Shouldn't easy_install be reading the pypi data, which points to the
> proper sf page?
>
> http://pypi.python.org/pypi/matplotlib

Yup, but the link URLs are of the form

http://sourceforge.net/.../.egg/download

which does not obviously mean "this is the URL for .egg" unless if you 
know 
to remove the final /download part.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Circular colormaps

2009-11-09 Thread Robert Kern
On 2009-11-09 11:46 AM, Chloe Lewis wrote:
> ... and for dessert, is there a circular colormap that would work for
> the colorblind?

Almost certainly not, at least not without compromising other desirable 
features 
for circular colormaps. You could do a circle roughly perpendicular to the 
lines 
of confusion, but this would mean going up and down in lightness, which 
perceptually overemphasizes the light half.

On the other hand, this may not be a bad thing if 0 degrees and/or 180 degrees 
are special as might be the case with phase measurements and other complex 
number-related things.

> My department is practicing presenting-science-for-the-general-public,
> and the problems 'heat maps' have for the colorblind keep coming up.

As a deuteronopic, I heartily thank you for paying attention to these issues.

I've written an application to visualize colormaps in 3D perceptual space as 
well as simulating colorblindness. It uses Mayavi and Chaco, so you will need a 
full Enthought Tool Suite installation:

http://www.enthought.com/~rkern/cgi-bin/hgwebdir.cgi/colormap_explorer/

Of interest for this thread might be the function find_chroma() in hcl_opt.py 
which will, given a lightness value in HCL space, find the largest chroma value 
(roughly similar to saturation) such that a circle at the given lightness value 
will just fit inside of the RGB gamut. A simple maximization on that function 
will find the lightness that gives the largest chroma and hence the largest 
dynamic range of such a colormap. However, it should be noted that I have found 
such colormaps to appear a little washed out and drab. But then, I'm colorblind.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib with Qt4 backend

2009-11-12 Thread Robert Kern
On 2009-11-12 12:05 PM, Andrew Straw wrote:
> Celil Rufat wrote:
>> I just installed matplotlib on Snow Leopard 10.6 with the Qt4 backend
>> (via macports). However, when I try one of the Qt4 examles:
>>
>> python
>> /opt/local/share/py26-matplotlib/examples/user_interfaces/embedding_in_qt4.py
>>
>>
>> IOError: [Errno 4] Interrupted system call
>>
>> Any ideas on what could be causing this?
> Out of curiosity, does anyone know where the signal interrupting the
> system call is originating? Is this a standard communication mechanism
> within Qt4? (I have never used Qt4.) I'm interested in knowing about OSS
> that use signals as a means of across-thread or across-process
> communication.

This problem arises when signal handlers are installed, not necessarily when a 
signal itself is sent (dtrace doesn't detect any). PyQt4 doesn't do it, but I 
think something in QApplication does. I really don't know what, though. Here 
are 
the files that call signal(3) or sigaction(3):

./src/3rdparty/freetype/src/tools/ftrandom/ftrandom.c
./src/3rdparty/phonon/qt7/quicktimevideoplayer.mm
./src/3rdparty/sqlite/shell.c
./src/3rdparty/webkit/JavaScriptCore/jsc.cpp
./src/corelib/io/qfilesystemwatcher_dnotify.cpp
./src/corelib/io/qprocess_unix.cpp
./src/corelib/kernel/qcrashhandler.cpp
./src/corelib/kernel/qeventdispatcher_unix.cpp
./src/gui/embedded/qwindowsystem_qws.cpp
./src/gui/embedded/qwssignalhandler.cpp
./tools/qvfb/main.cpp

It's not obvious to me that any of these are activated on OS X (the 
qcrashhandler.cpp file is intriguing, but it only seems to be used in the X11 
QApplication). dtrace doesn't actually show either signal(3) or sigaction(3) 
being called at all. Actually, running a program under dtrace while probing 
those functions makes the problem go away. Sometimes.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib with Qt4 backend

2009-11-12 Thread Robert Kern
On 2009-11-12 16:44 PM, Andrew Straw wrote:
> Robert Kern wrote:
>> On 2009-11-12 12:05 PM, Andrew Straw wrote:
>>
>>> Celil Rufat wrote:
>>>
>>>> I just installed matplotlib on Snow Leopard 10.6 with the Qt4 backend
>>>> (via macports). However, when I try one of the Qt4 examles:
>>>>
>>>> python
>>>> /opt/local/share/py26-matplotlib/examples/user_interfaces/embedding_in_qt4.py
>>>>
>>>>
>>>> IOError: [Errno 4] Interrupted system call
>>>>
>>>> Any ideas on what could be causing this?
>>>>
>>> Out of curiosity, does anyone know where the signal interrupting the
>>> system call is originating? Is this a standard communication mechanism
>>> within Qt4? (I have never used Qt4.) I'm interested in knowing about OSS
>>> that use signals as a means of across-thread or across-process
>>> communication.
>>>
>>
>> This problem arises when signal handlers are installed, not necessarily when 
>> a
>> signal itself is sent (dtrace doesn't detect any).
> Hmm, but a system call isn't going to get interrupted and return EINTR
> by any means other than a signal. So the OP must have had a signal
> interrupting the call and it must have come from somewhere. Or... am I
> wrong?

Well, SIGCHLD is sent by the OS when the child process completes. There is a 
SIGCHLD handler registered in ./src/corelib/io/qprocess_unix.cpp . I'm not sure 
how to avoid it, though.

I think I can verify this now:

$ really dtrace -n 'proc:::signal-handle /pid==$target/ { ustack(); 
printf("Signal: %d\n", arg0);}' -c "python application.py"
dtrace: description 'proc:::signal-handle ' matched 2 probes
Traceback (most recent call last):
   File "application.py", line 247, in 
 commands.getstatusoutput( "otool -L %s | grep libedit" % _rl.__file__ )
   File 
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/commands.py", 
line 54, in getstatusoutput
 text = pipe.read()
IOError: [Errno 4] Interrupted system call
dtrace: pid 47973 has exited
CPU IDFUNCTION:NAME
   1  18577sendsig:signal-handle
   libSystem.B.dylib`read+0xa
   libSystem.B.dylib`__srefill+0x127
   libSystem.B.dylib`fread+0x9f
   0x1c2d9b
   0x23affa
   0x23bde1
   0x23c7fa
   0x23c907
   0x260d37
   0x2610e3
   0x26f855
   python`0x1f82
   python`0x1ea9
   0x2
Signal: 20

$ python -c "import signal;print signal.SIGCHLD"
20


So it is getting SIGCHLD. I think my previous probes weren't getting signals 
from the OS itself.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Replying with Thunderbird. Reply All doesn't cut it all the time.

2009-12-07 Thread Robert Kern
Scott Sinclair wrote:
>> 2009/12/7 Wayne Watson :
>> I see a variance with replying to a post on this list and other Python
>> lists. It appears to be a difference between the way people post. If I
>> see From: a...@xyz.net and To: 
>> matplotlib-users-5nwgofrqmnerv+lv9mx5uipxlwaov...@public.gmane.org,
>> then Reply All gets both. If I see, From: joe...@xyz.net and To: my
>> e-mail address (or any personal e-address), then Reply All only goes to
>> the From e-address, which means I have to fill in the e-address for this
>> mail list. Apparently, some people from outside using a mail program
>> like Thunderbird. How do I get two for price of one, so to speak?
> 
> The default "Reply To" on this list is set to go to the original
> poster. It's a setting in the mailing list software, not anyone's
> e-mail client.
> 
> If you post a question and someone responds using "Reply To", then
> their response will go directly to you. If they respond using "Reply
> To All" (as I have here) then the e-mail is copied to the list address
> as well.
> 
> The moral? Always use "Reply To", and hope everyone else remembers to
> do so as well :)

Did you mean "Reply All"?

Some of us would appreciate it if people just responded to the list and not 
including our individual addresses at all. With very rare exceptions, everyone 
who posts is already on the list. I subscribe to the list via the GMane NNTP 
interface and hate receiving private-looking (hence urgent-looking) replies in 
my inbox.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Import bug for numpy >= 2.0

2010-02-15 Thread Robert Kern
On 2010-02-14 11:23 AM, Charles R Harris wrote:
> Lines 147-151 of __init__ need to be changed to
>
> import numpy
> nn = numpy.__version__.split('.')
> if not (int(nn[0]) > 1 or int(nn[0]) == 1 and int(nn[1]) >= 1):
>  raise ImportError(
> 'numpy 1.1 or later is required; you have %s' % numpy.__version__)

It's been noted and fixed in SVN.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Trouble gridding irregularly spaced data

2010-02-16 Thread Robert Kern
On 2010-02-16 00:40 AM, T J wrote:
> Hi,
>
> I'm trying to grid irregularly spaced data, such that the convex hull
> of the data is not rectangular.  Specifically, all my data lies in an
> equilateral triangle inside the unit circle.  I found:
>
>   
> http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data
>
> and tried the suggested technique.  For my grid, I made a square of
> the min and max of my data.  However, it had problems:
>
> ...
>File 
> "/home/guest/.local/lib/python2.6/site-packages/matplotlib/delaunay/triangulate.py",
> line 125, in _compute_convex_hull
>  hull.append(edges.pop(hull[-1]))
> KeyError: 0
>
>
> Should I expect matplotlib.mlab.griddata to work with a dataset like
> this?  I know that I can use hexbin, but it'd be really nice to see
> contours explicitly.

It's not a problem with your points lying inside a triangle. There is some 
other 
problem with the construction of the Delaunay triangulation. Sometimes the 
algorithm fails. This is one way that it fails.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Bug: string.letters

2010-03-09 Thread Robert Kern
On 2010-03-09 12:37 PM, Eric Firing wrote:
> Eric Firing wrote:
>> Tony S Yu wrote:
>>> On Mar 9, 2010, at 1:22 PM, John Hunter wrote:
>>>
>>>> On Tue, Mar 9, 2010 at 12:16 PM, Eric Firing  wrote:
>>>>
>>>>> Bizarre!  I can reproduce it with python 2.6 (ubuntu 9.10) and mpl from
>>>>> svn.  I have done a little grepping and other exploration, but have
>>>>> completely failed to find where this change is occurring.
>>>>
>>>> cbook imports locale -- may be implicated:
>>>>
>>>> string.letters¶
>>>> The concatenation of the strings lowercase and uppercase described
>>>> below. The specific value is locale-dependent, and will be updated
>>>> when locale.setlocale() is called.
>>>>
>>>> See if simply importing locale first has the same effect.
>>>
>>> It seems to be an interaction between numpy and locale. I can reproduce the 
>>> problem with:
>>>
>>>>>> import locale
>>>>>> import numpy as np
>>>>>> preferredencoding = locale.getpreferredencoding()
>>
>> cbook also calls locale.getpreferredencoding() when it is imported.
>
> Confirmation:
>
> In [1]:import string
>
> In [2]:string.letters
> Out[2]:'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
>
> In [3]:import locale
>
> In [4]:locale.getpreferredencoding ()
> Out[4]:'UTF-8'
>
> In [5]:string.letters
> Out[5]:'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'

PyGTK calls locale.setlocale() and thus may be affecting string.letters.

 > The lesson seems to be that the only proper use for string.letters is
 > for testing membership, in which case the order does not matter.

Yes.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Contour Plotting of Varied Data on a Shape

2010-03-11 Thread Robert Kern
On 2010-03-11 13:38 PM, Chris Barker wrote:
> Ian Thomas wrote:
>> To summarise, you recommend the following units of functionality:
>>
>> 1) Triangulation class to wrap existing delaunay code.
>
> The idea here is that it would provide a class that holds the result of
> the triangulation. Yes, it would use the existing delaunay code by
> default, and hopefully optionally use the not-as-good-a-license code the
> Robert Kern put in SciPy.

I did what now?

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Contour Plotting of Varied Data on a Shape

2010-03-11 Thread Robert Kern
On 2010-03-11 15:49 PM, Chris Barker wrote:
> Robert Kern wrote:
>>> the triangulation. Yes, it would use the existing delaunay code by
>>> default, and hopefully optionally use the not-as-good-a-license code the
>>> Robert Kern put in SciPy.
>>
>> I did what now?
>
> I thought you'd put a wrapper of a delaunay code that is GPL'd or
> something (not BSD compatible anyway) into a scikit or something?
> optional -- so it doesn't screw up licensing for those that don't want it.
>
> Anyway, the point is, for any code that might be put into MPL, we want a
> properly licensed compatible default, but ideally with the option of
> easily plug in in other, better, delaunay code that may not be license
> compatible.
>
> Now that I've written this, I really should go and look and see if I
> remember correctly:
>
> I've found this:
>
> http://scikits.appspot.com/delaunay
>
> Though I see no reference to license in there, so I presume it's under
> the same license as scipy.
>
> So I guess I was thinking of the natgrid toolkit, which I guess is not
> Robert's work, and is a substitute for nn interpolation, not triangulation.
>
> Sorry for writing too quickly.

Instead of addressing the misconceptions point by point, let me just lay out 
the 
situation:

natgrid is a GPLed library for doing Delaunay triangulation and natural 
neighbor 
interpolation. The author is presumed to be deceased, so this code will always 
be GPLed. It seems to fail less often when doing the Delaunay triangulation on 
datasets in the wild; however, it is not using robust geometric primitives, so 
there probably still are cases where it fails.

I wrote a BSD library for doing natural neighbor interpolation using the 
Delaunay triangulation code using the sweepline algorithm. This algorithm does 
not (and cannot) use robust geometric primitives, so there are datasets for 
which it fails to produce a valid triangulation. This is the code in 
scikits.delaunay. I have not pushed it to a 1.0 release because of this issue. 
However, this *was* put into matplotlib. matplotlib can optionally use natgrid 
if it is installed.

> While I've got your attention, though -- I suspect you have looked for
> license compatible delaunay code and the stuff in the scikits package is
> as good as it gets?

Pretty much. I do have some code for constructing the Delaunay triangulation 
using robust primitives and an insertion algorithm, but it is an order of 
magnitude slower than scikits.delaunay. Ideally, we would be able to find or 
write a divide-and-conquer algorithm using Jon Shewchuk's robust geometric 
primitives.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ipython pylab switch, GDAL, Enthought

2010-04-13 Thread Robert Kern
On 2010-04-13 10:18 AM, K. -Michael Aye wrote:
> Dear all,
>
> maybe this should go to the Enthought list, but as the failure is directly 
> related to the pylab switch of ipython, I thought I try it here first:
>
> On OSX I have trouble with using the pylab switch for ipython after I copied 
> the gdal.pth into the Enthought site-packages folder (to be able to use my 
> KyngChaos GDAL Frameworks inside the Enthought Python).
>
> The gdal.pth does the following to the sys.path:
> import sys; 
> sys.path.insert(0,'/Library/Frameworks/GDAL.framework/Versions/1.7/Python/site-packages')
>
> and in that folder there is:
>
> -rw-rw-r--   1 root  admin   128B  8 Feb 20:52 gdal.py
> -rw-r--r--   1 root  admin   274B  3 Mar 23:20 gdal.pyc
> -rw-rw-r--   1 root  admin   143B  8 Feb 20:52 gdalconst.py
> -rw-r--r--   1 root  admin   304B  3 Mar 23:20 gdalconst.pyc
> -rw-rw-r--   1 root  admin   147B  8 Feb 20:52 gdalnumeric.py
> -rw-r--r--   1 root  admin   309B  3 Mar 23:20 gdalnumeric.pyc
> drwxrwxr-x  42 root  admin   1.4K  3 Mar 23:20 numpy
> -rw-rw-r--   1 root  admin   125B  8 Feb 20:52 ogr.py
> -rw-r--r--   1 root  admin   286B  3 Mar 23:20 ogr.pyc
> drwxrwxr-x  21 root  admin   714B  3 Mar 23:20 osgeo
> -rw-rw-r--   1 root  admin   125B  8 Feb 20:52 osr.py
> -rw-r--r--   1 root  admin   286B  3 Mar 23:20 osr.pyc
>
> Maybe the double import of a potentially different numpy compared to the 
> Enthought numpy creates the Bus Error?

Not so much a double import. Only one version ever gets imported, but the GDAL 
Python bindings expect its version and matplotlib expects another version.

> If so, how can I avoid it?

You would have to rebuild the GDAL Python bindings against Enthought's numpy.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ipython pylab switch, GDAL, Enthought

2010-04-13 Thread Robert Kern
On 2010-04-13 11:13 AM, K. -Michael Aye wrote:
>>
>> On 2010-04-13 10:18 AM, K. -Michael Aye wrote:
>>> Dear all,
>>>
>>> maybe this should go to the Enthought list, but as the failure is directly 
>>> related to the pylab switch of ipython, I thought I try it here first:
>>>
>>> On OSX I have trouble with using the pylab switch for ipython after I 
>>> copied the gdal.pth into the Enthought site-packages folder (to be able to 
>>> use my KyngChaos GDAL Frameworks inside the Enthought Python).
>>>
>>> The gdal.pth does the following to the sys.path:
>>> import sys; 
>>> sys.path.insert(0,'/Library/Frameworks/GDAL.framework/Versions/1.7/Python/site-packages')
>>>
>>> and in that folder there is:
>>>
>>> -rw-rw-r--   1 root  admin   128B  8 Feb 20:52 gdal.py
>>> -rw-r--r--   1 root  admin   274B  3 Mar 23:20 gdal.pyc
>>> -rw-rw-r--   1 root  admin   143B  8 Feb 20:52 gdalconst.py
>>> -rw-r--r--   1 root  admin   304B  3 Mar 23:20 gdalconst.pyc
>>> -rw-rw-r--   1 root  admin   147B  8 Feb 20:52 gdalnumeric.py
>>> -rw-r--r--   1 root  admin   309B  3 Mar 23:20 gdalnumeric.pyc
>>> drwxrwxr-x  42 root  admin   1.4K  3 Mar 23:20 numpy
>>> -rw-rw-r--   1 root  admin   125B  8 Feb 20:52 ogr.py
>>> -rw-r--r--   1 root  admin   286B  3 Mar 23:20 ogr.pyc
>>> drwxrwxr-x  21 root  admin   714B  3 Mar 23:20 osgeo
>>> -rw-rw-r--   1 root  admin   125B  8 Feb 20:52 osr.py
>>> -rw-r--r--   1 root  admin   286B  3 Mar 23:20 osr.pyc
>>>
>>> Maybe the double import of a potentially different numpy compared to the 
>>> Enthought numpy creates the Bus Error?
>>
>> Not so much a double import. Only one version ever gets imported, but the 
>> GDAL
>> Python bindings expect its version and matplotlib expects another version.
>>
>>> If so, how can I avoid it?
>>
>> You would have to rebuild the GDAL Python bindings against Enthought's numpy.
>>
> But why does everything work fine, when I start an Enthought ipython withOUT 
> the -pylab switch?
> Importing 'from osgeo import gdal' and using it works fine in this case 
> (Tried ReadAsArray from a gdal dataset and imshow'ed it without problems, 
> apart from that I had to call show() because of the lack of the -pylab 
> switch, but other than that, fine).

Hmm, don't know. Getting a gdb traceback for the bus error would help identify 
the problem.

> PS.: Sorry for the mail-list noob question, but how can I nicely reply to 
> your answer like you replied to my question, with 'Robert Kern wrote' and so 
> on? There's no reply possible on sourceforge and the digest contains 
> obviously many emails, so how do you do this? ;)

I use an NNTP newsreader to read this list via GMane, but you can just change 
your subscription to not use the digest. Scroll down to the bottom of this page 
to log in and edit your delivery options:

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

You will get every message in your inbox individually. You should do this if 
you 
are going to be replying to messages. Please consider the digest as read-only.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ipython pylab switch, GDAL, Enthought

2010-04-13 Thread Robert Kern
On 2010-04-13 16:55 PM, K.-Michael Aye wrote:

> Trying Unison via the GMane NNTP now, but weird that nabble has your
> last answer already for long time, whereas GMane still does not show
> it. Does the NNTP pull the mailing lists on a low frequency.

The latency is variable, but it's been getting pretty bad recently.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] findobj in pylab

2008-07-04 Thread Robert Cimrman
John Hunter wrote:
> On Thu, Jul 3, 2008 at 8:42 AM, John Kitchin <[EMAIL PROTECTED]> wrote:
>> Thanks Matthias. That is a helpful example.
>>
>> I have been trying to figure out how to recursively examine all the objects
>> in fig to see if there is a particular settable property. It seems like the
>> algorithm has to be recursive so that it goes deep into all the lists, etc.
>> I have not figured out how to know when you have reached the bottom/end of a
>> trail.
>>
>> Such a function would let me set any text property in the whole figure
>> without needing to know if it was a text object, label, legend, etc... maybe
>> that is not as valuable as I think it would be though.
> 
> This is a good idea, and I just added an artist method "findobj" in
> svn that recursively calls get_children and implements a match
> criteria (class instance or callable filter).  There is also a
> pyplot/pylab wrapper that operates on current figure by default.  Here
> is an example:
> 
> 
> 
> import numpy as np
> import matplotlib.pyplot as plt
> import matplotlib.text as text
> 
> a = np.arange(0,3,.02)
> b = np.arange(0,3,.02)
> c = np.exp(a)
> d = c[::-1]
> 
> fig = plt.figure()
> ax = fig.add_subplot(111)
> plt.plot(a,c,'k--',a,d,'k:',a,c+d,'k')
> plt.legend(('Model length', 'Data length', 'Total message length'),
>'upper center', shadow=True)
> plt.ylim([-1,20])
> plt.grid(False)
> plt.xlabel('Model complexity --->')
> plt.ylabel('Message length --->')
> plt.title('Minimum Message Length')
> 
> # match on arbitrary function
> def myfunc(x):
> return hasattr(x, 'set_color')
> 
> for o in fig.findobj(myfunc):
> o.set_color('blue')
> 
> # match on class instances
> for o in fig.findobj(text.Text):
> o.set_fontstyle('italic')

Great! I used to write many such functions for setting font sizes of all
elements in a figure. But speaking about the font sizes, one usually 
wants the title to be in larger font then the axis labels etc. How could 
something like this be implemented within your general findobj()?

Just for the reference, this is how I did it:
def setAxesFontSize( ax, size, titleMul = 1.2, labelMul = 1.0 ):
 """size: tick label size,
titleMul: title label size multiplicator,
labelMul: x, y axis label size multiplicator"""
 labels = ax.get_xticklabels() + ax.get_yticklabels()
 for label in labels:
 label.set_size( size )

 labels = [ax.get_xaxis().get_label(), ax.get_yaxis().get_label()]
 for label in labels:
 label.set_size( labelMul * size )

 for child in ax.get_children():
 if isinstance( child, pylab.Text ):
 child.set_size( titleMul * size )

Maybe it could be implemented in the sense of:

def myfontsizes( x ):
 """Depending on class of x, return also suggested value of the font 

size."""

for o, size in fig.findobj( myfontsizes, suggest_value = True ):
 o.set_size( size )

# Default for suggest_value is False...
for o in fig.findobj(text.Text):
 o.set_fontstyle('italic')

What do you think?
r.

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] findobj in pylab

2008-07-04 Thread Robert Cimrman
Eric Firing wrote:
> I'm not sure if this is addressing your situation, but the simplest way 
> to adjust all font sizes is to use the rcParams dictionary, either 
> directly or via the matplotlibrc file.  If the default font sizes for 
> various items are specified using "medium", "large", etc, instead of 
> with numerical values in points, then everything can be scaled by 
> changing the single value, font.size, which is the point size 
> corresponding to "medium".

Yes, this certainly works, but only for future plots, no? Or it works
also if a figure already exists and I want to play with the sizes to get
something that looks nice?

r.



-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] findobj in pylab

2008-07-07 Thread Robert Cimrman
Eric Firing wrote:
> Robert Cimrman wrote:
>> Eric Firing wrote:
>>> I'm not sure if this is addressing your situation, but the simplest 
>>> way to adjust all font sizes is to use the rcParams dictionary, 
>>> either directly or via the matplotlibrc file.  If the default font 
>>> sizes for various items are specified using "medium", "large", etc, 
>>> instead of with numerical values in points, then everything can be 
>>> scaled by changing the single value, font.size, which is the point 
>>> size corresponding to "medium".
>>
>> Yes, this certainly works, but only for future plots, no? Or it works 
>> also if a figure already exists and I want to play with the sizes to 
>> get something that looks nice?
> 
> You are correct, it is for future plots, not for interactive 
> experimentation with font sizes.  An alternative, though, is to make a 
> very simple script with a test plot using rcParams, run that repeatedly 
> as needed to tune the values, and then use those values when making the 
> plots you want to keep.

Yep. That, or accessing the object properties specific for a given 
figure, as posted in my first message. I am by no means saying that the 
rcParams way is not sufficient, I just wanted to elaborate a bit on the 
findobj idea, as an alternative...

Thanks for your feedback,
r.

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] installation

2008-09-19 Thread Robert Fenwick
Hi,

I would really like to use matplot lib, however I am having big
problems as I try to do this on OSX 10.5. if there is someone how
could give a detailed explination of how to get rid of the
preinstalled python that is apparently rubbish and then how to install
a new python version that would really help me. I am completely lost
in a world of eggs etc.

Bryn

P.S. here is my particular compilation problem. Is there a simple
solution so that I can code my first graph today?

salvatella02:Downloads rbf$ sudo easy_install
matplotlib-0.98.3-py2.5-macosx-10.3.egg
Password:
Processing matplotlib-0.98.3-py2.5-macosx-10.3.egg
removing 
'/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.3-py2.5-macosx-10.3.egg'
(and everything under it)
creating 
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.3-py2.5-macosx-10.3.egg
Extracting matplotlib-0.98.3-py2.5-macosx-10.3.egg to
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages
Adding matplotlib 0.98.3 to easy-install.pth file

Installed 
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.3-py2.5-macosx-10.3.egg
Processing dependencies for matplotlib==0.98.3
Searching for matplotlib==0.98.3
Reading http://pypi.python.org/simple/matplotlib/
Reading http://matplotlib.sourceforge.net
Reading 
https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=278194
Reading 
https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474
Reading 
http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474
Reading http://sourceforge.net/project/showfiles.php?group_id=80706
Best match: matplotlib 0.98.3
Downloading 
http://downloads.sourceforge.net/matplotlib/matplotlib-0.98.3.tar.gz?modtime=1217773039&big_mirror=0
Processing matplotlib-0.98.3.tar.gz
Running matplotlib-0.98.3/setup.py -q bdist_egg --dist-dir
/tmp/easy_install-JGl_1Z/matplotlib-0.98.3/egg-dist-tmp-T6PVvy

BUILDING MATPLOTLIB
matplotlib: 0.98.3
python: 2.5.2 (r252:60911, Feb 22 2008, 07:57:53)  [GCC
4.0.1 (Apple Computer, Inc. build 5363)]
  platform: darwin

REQUIRED DEPENDENCIES
 numpy: 1.1.1
 freetype2: found, but unknown version (no pkg-config)

OPTIONAL BACKEND DEPENDENCIES
libpng: found, but unknown version (no pkg-config)
   Tkinter: Tkinter: 50704, Tk: 8.4, Tcl: 8.4
  wxPython: no
* wxPython not found
  Gtk+: no
* Building for Gtk+ requires pygtk; you must be able
* to "import gtk" in your build/install environment
Qt: no
   Qt4: no
 Cairo: no

OPTIONAL DATE/TIMEZONE DEPENDENCIES
  datetime: present, version unknown
  dateutil: matplotlib will provide
  pytz: matplotlib will provide

OPTIONAL USETEX DEPENDENCIES
dvipng: 1.9
   ghostscript: 8.57
 latex: 3.141592

EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES
 configobj: matplotlib will provide
  enthought.traits: no

[Edit setup.cfg to suppress the above messages]

warning: no files found matching 'NUMARRAY_ISSUES'
warning: no files found matching 'MANIFEST'
warning: no files found matching 'matplotlibrc'
warning: no files found matching 'makeswig.py'
warning: no files found matching 'examples/data/*'
warning: no files found matching 'lib/mpl_toolkits'
warning: no files found matching '*' under directory 'examples'
warning: no files found matching '*' under directory 'swig'
gcc: unrecognized option '-no-cpp-precomp'
cc1plus: error: unrecognized command line option "-arch"
cc1plus: error: unrecognized command line option "-arch"
cc1plus: warning: unrecognized command line option "-Wno-long-double"
error: Setup script exited with error: command 'gcc' failed with exit status 1
Exception exceptions.OSError: (2, 'No such file or directory',
'src/image.cpp') in > ignored
Exception exceptions.OSError: (2, 'No such file or directory',
'src/path.cpp') in > ignored
Exception exceptions.OSError: (2, 'No such file or directory',
'src/backend_agg.cpp') in > ignored

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/li

Re: [Matplotlib-users] scipy, matplotlib import errors

2008-09-25 Thread Robert Kern
John [H2O] wrote:
> I wonder if I've misunderstood or made a mistake? I renamed a file:
> /usr/lib/python2.5/new.py to /usr/lib/python2.5/new.bak
> 
> and everything worked... but now, after logging out and logging back in
> again, I'm getting the problem again?
> 
> Perhaps that was the standard libraries module? But I cannot find any other
> new.py files?

/usr/lib/python2.5/new.py is the standard library's module. Leave it alone. If 
you are still having problems and cannot find another new.py module anywhere, 
edit pkg_resources.py to print out new.__file__ just before where the exception 
occurs.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib egg finds wrong version of numpy

2008-11-17 Thread Robert Kern
Jeff Mangum wrote:
> Hello,
> 
> I am having a problem installing matplotlib 0.93.3 from egg on Mac OSX 
> 10.5.5.  Even though I have numpy 1.2.1 installed in 
> /Library/Frameworks/..., the egg insists on using an older version of 
> numpy (1.0.4) in /opt/local/lib/python2.5/site-packages (which must have 
> been delivered with the OS). 

No, /opt/local is MacPorts territory.

> How can I tell the egg where to find the 
> proper version of numpy?  Thanks!

Are you sure you are using the same versions of Python to run and install both 
of these?

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib egg finds wrong version of numpy

2008-11-18 Thread Robert Kern
Jeff Mangum wrote:

> How can I instruct the matplotlib install to find the appropriate python
> install?  Thanks!

Your easy_install script is the one that comes from OS X's Python. Install 
setuptools for your www.python.org Python and use the easy_install script that 
it installs, instead. The Python executable that gets run by the easy_install 
script is the one which the eggs get installed for.

   http://pypi.python.org/pypi/setuptools

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib egg finds wrong version of numpy

2008-11-18 Thread Robert Kern
Jeff Mangum wrote:

> Thanks Robert.  I grabbed setuptools and reinstalled.  Unfortunately, even
> though I am using the right version of easy_install...
> 
> torgo:Desktop jmangum$ which easy_install
> /Library/Frameworks/Python.framework/Versions/Current/bin/easy_install
> 
> ...I still get the same error when installing matplotlib...
> 
> 
> BUILDING MATPLOTLIB
> matplotlib: 0.98.3
> python: 2.5.1 (r251:54863, Apr 15 2008, 22:57:26)  [GCC
> 4.0.1 (Apple Inc. build 5465)]

This is Apple's Python, not python.org Python.

$ /usr/bin/python
Python 2.5.1 (r251:54863, Apr 15 2008, 22:57:26)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

$ /Library/Frameworks/Python.framework/Versions/Current/bin/python
Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib egg finds wrong version of numpy

2008-11-18 Thread Robert Kern
Jeff Mangum wrote:

> Hmmm.  Got it from python.org (http://python.org/download/releases/2.5.2/)
> and just reinstalled to make sure.  Indeed the binary is in
> /Library/Frameworks/Python.framework/Versions/Current/bin/python.

I know that you have the python.org Python installed. However, it may not be 
the 
Python that the easy_install script is using. Check the contents of the 
easy_install file. It ought to point to /Library/Frameworks/.../Python at the 
top. Try explicitly running /Library/Frameworks/.../bin/easy_install instead.

> I am seeing some other problems (like PPC binaries in /opt/local/bin).  I
> have recently migrated from PPC to Intel Mac, and I suspect that the
> migration assistant may have been too thorough...

Your PYTHONPATH may also be messed up.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem Using/Installing the matplotlib

2009-02-10 Thread Robert Kern
On 2009-02-10 15:26, Gustavo Blando wrote:
> Hi, I am new to Python, and I am trying to install the matplotlib but it is
>> not working.
>> I would appreciate your help.
>   I am using Python with the PythonWin environment.
>   I have created a PYTHONPATH on my environment variables to make
>   sure I point to all the libraries.
>   I have installed the numpy, scipy and other libraries that seems
>   to work just fine.
>
> BUT when I try to load the matplotlib, this is what I get:
>
>> ERROR:
>> ==
>> from matplotlib import *
>> Traceback (most recent call last):
>>   File "", line 1, in
>>   File "C:\Python25\Lib\site-packages\matplotlib\__init__.py", line 97, in
>> 
>>import distutils.sysconfig
>>   File "C:\Python25\Lib\site-packages\numpy\distutils\__init__.py", line 6,
>> in
>>import ccompiler
>>   File "C:\Python25\Lib\site-packages\numpy\distutils\ccompiler.py", line 7,
>> in
>>from distutils import ccompiler
>> ImportError: cannot import name ccompiler
>
>>   - It's having a problem with ccompiler, but ccompiler.py is on that
>> directory.

It looks like you have a problem with your PYTHONPATH. You shouldn't have 
c:\Python25\Lib\site-packages\numpy\ on your PYTHONPATH. Show me your 
PYTHONPATH, and I can point out what else is wrong.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem Using/Installing the matplotlib

2009-02-10 Thread Robert Kern
On 2009-02-10 16:50, Gustavo Blando wrote:
> Awesome Robert, thanks.
> Here is the Python path.
>
> C:\Python25\Lib\site-packages\numpy;C:\Python25\Lib\site-packages\matplotlib;C:\Python25\Lib\site-packages\scipy;C:\Python25\Lib\site-packages\pyreadline;C:\Python25\Lib\site-packages;C:\StatEye\v5_2;C:\Python25\Lib\site-packages\numpy;C:\Python25\Lib\site-packages\matplotlib;C:\Python25\Lib\site-packages\scipy;C:\Python25\Lib\site-packages\pyreadline;C:\Python25\Lib\site-packages\numpy;C:\Python25\Lib\site-packages\matplotlib;C:\Python25\Lib\site-packages\scipy;C:\Python25\Lib\site-packages\pyreadline;C:\Python25\Lib\site-packages

Okay, none of that is necessary except for C:\StatEye\v5_2 . site-packages will 
already be on your sys.path, so putting it on the PYTHONPATH is unnecessary. 
The 
package directories like numpy and matplotlib definitely should *not* be on 
your 
PYTHONPATH or sys.path. It is the directory that *contains* your packages that 
needs to be on the sys.path; but as I already noted, site-packages is built in, 
so you don't need to add it yourself.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] plotting in a separate process

2009-03-31 Thread Robert Cimrman

Hi all!

I have a long running (non-GUI) python application, that needs to plot
some curves and update them in time, as new data are computed. I'm
well aware of ezplot, but would like to use a 
matplotlib-multiprocessing-only solution, as I have already enough

dependencies.

The best thing I have come so far with is essentially in the attached 
script (I stripped all unneeded dependencies and fancy stuff). It works 
quite well in terms that it plots as the data arrive, but I cannot find 
a way how to stop it cleanly. At the end, it just hangs (Ctrl-C does not 
help). I would appreciate any hints on what is wrong.


There are two classes: NBPlot spawns the new process and feeds it the 
data, ProcessPlotter is the "remote" plotter class plotting the data as 
they arrive. The plot update is done using gobject.timeout_add() 
according to the matplotlib examples. It can be run as:


$ python log.py

Best regards and thanks for your suggestions,
r.
import time
from multiprocessing import Process, Queue
from Queue import Empty
import numpy as np
import pylab
import gobject

class ProcessPlotter(object):

def __init__(self):
self.x = []
self.y = []

def terminate(self):
pylab.close('all')

def poll_draw(self):

def call_back():
while 1:
try:
command = self.queue.get_nowait()
except Empty:
break

print command

if command is None:
self.terminate()
return False

else:
self.x.append(command[0])
self.y.append(command[1])
self.ax.plot(self.x, self.y, 'ro')

self.fig.canvas.draw()
return True

return call_back

def __call__(self, queue):
print 'starting plotter...'

self.queue = queue
self.fig = pylab.figure()

self.ax = self.fig.add_subplot(111)
self.gid = gobject.timeout_add(1000, self.poll_draw())

print '...done'
pylab.show()


class NBPlot(object):
def __init__(self):
self.plot_queue = Queue()
self.plotter = ProcessPlotter()
self.plot_process = Process( target = self.plotter,
 args = (self.plot_queue,) )
self.plot_process.daemon = True
self.plot_process.start()

def plot(self, finished=False):
put =  self.plot_queue.put
if finished:
put(None)
else:
data = np.random.random(2)
put(data)

def main():
pl = NBPlot()
for ii in xrange(10):
pl.plot()
time.sleep(0.5)
raw_input()
pl.plot(finished=True)

if __name__ == '__main__':
main()
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 2 simple ??: program exit w/graph, update graph real-time

2009-04-24 Thread Robert Cimrman
Hi Ryan,

Ryan May wrote:
> On Thu, Apr 23, 2009 at 4:16 PM, Esmail  wrote:
> 
>> Ryan May wrote:
>>> Try this:
>>>
>>>
>> http://matplotlib.sourceforge.net/examples/animation/simple_anim_gtk.html
>>> (If not gtk, there are other examples there.)
>> Thanks Ryan, that'll give me some idea with regard to the animation,
>> and real-time drawings.
>>
>> Any idea if it's possible to finish a Python program but still have the
>> graph showing?
>>
>> FWIW, I'm doing this under Linux.
>>
> 
> You'd have to run the plotting in a separate process from the computation.
> subprocess would let you do that, assuming you can spin off a child task
> that stays alive when the parent exits.  You'd also need to get the
> computing process to give new results to the child plot, maybe using a pipe
> (which I think subprocess can handle as well.)

This is exactly what I have tried/described in [1], using the 
multiprocessing module. It sort of works, but I have that hanging 
problem at the end - maybe somebody jumps in and helps this time :)

r.

[1] 
http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg10873.html

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 2 simple ??: program exit w/graph, update graph real-time

2009-04-24 Thread Robert Cimrman
Esmail wrote:
> Robert Cimrman wrote:
>> This is exactly what I have tried/described in [1], using the 
>> multiprocessing module. It sort of works, but I have that hanging 
>> problem at the end - maybe somebody jumps in and helps this time :)
>>
>> r.
>>
>> [1] 
>> http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg10873.html
> 
> Hi,
> 
> Sounds interesting, but I get a "page not found 404" type error when
> I follow this link.

Strange, it does work for me. Alternatively, just search
"[Matplotlib-users] plotting in a separate process" in google...

r.


--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 2 simple ??: program exit w/graph, update graph real-time

2009-04-24 Thread Robert Cimrman
Ryan May wrote:
> On Fri, Apr 24, 2009 at 5:52 AM, Esmail  wrote:
> 
>> Ryan May wrote:
>>> Any idea if it's possible to finish a Python program but still have
>> the
>>> graph showing?
>>>
>>> FWIW, I'm doing this under Linux.
>>>
>>>
>>> You'd have to run the plotting in a separate process from the
>>> computation.  subprocess would let you do that, assuming you can spin
>>> off a child task that stays alive when the parent exits.  You'd also
>>> need to get the computing process to give new results to the child plot,
>>> maybe using a pipe (which I think subprocess can handle as well.)
>> Thanks Ryan, I have been meaning to explore Python's
>> threading/multi-processing facilities, so this will provide a
>> good excuse to do so :-)  [when I find the time... so much to learn,
>> so little time]
> 
> 
> I was curious, so I cooked up a quick demo using two scripts.  Put them in
> the same directory and run datasource.py.  It's not perfect, and I think the
> use of raw_input() is a little odd, but it works.

Nice! I will try using the subprocess module instead of multiprocessing, 
as your example works for me.

Thanks!
r.

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 2 simple ??: program exit w/graph, update graph real-time

2009-05-06 Thread Robert Cimrman
Robert Cimrman wrote:
> Hi Ryan,
> 
> Ryan May wrote:
>> On Thu, Apr 23, 2009 at 4:16 PM, Esmail  wrote:
>>
>>> Ryan May wrote:
>>>> Try this:
>>>>
>>>>
>>> http://matplotlib.sourceforge.net/examples/animation/simple_anim_gtk.html
>>>> (If not gtk, there are other examples there.)
>>> Thanks Ryan, that'll give me some idea with regard to the animation,
>>> and real-time drawings.
>>>
>>> Any idea if it's possible to finish a Python program but still have the
>>> graph showing?
>>>
>>> FWIW, I'm doing this under Linux.
>>>
>> You'd have to run the plotting in a separate process from the computation.
>> subprocess would let you do that, assuming you can spin off a child task
>> that stays alive when the parent exits.  You'd also need to get the
>> computing process to give new results to the child plot, maybe using a pipe
>> (which I think subprocess can handle as well.)
> 
> This is exactly what I have tried/described in [1], using the 
> multiprocessing module. It sort of works, but I have that hanging 
> problem at the end - maybe somebody jumps in and helps this time :)
> 
> r.
> 
> [1] 
> http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg10873.html

Just for the record: Ryan May's example in this thread, that uses pipes, 
inspired me to try pipes as well, instead of queues 
(multiprocessing.Pipe instead of Queue) and the "hanging problem", i.e. 
the problem that Ctrl-C interrupted the program, but it had to be killed 
to stop, disappeared. I can fix the script that I sent in message [1] 
and provide it, if there is interest. (Currently I have fixed only the 
version that is within sfepy).

thanks!
r.

[1] [Matplotlib-users] plotting in a separate process, 31.03.2009

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 2 simple ??: program exit w/graph, update graph real-time

2009-05-06 Thread Robert Cimrman
Ryan May wrote:
> On Wed, May 6, 2009 at 7:57 AM, Robert Cimrman  wrote:
>>
>> Just for the record: Ryan May's example in this thread, that uses pipes,
>> inspired me to try pipes as well, instead of queues
>> (multiprocessing.Pipe instead of Queue) and the "hanging problem", i.e.
>> the problem that Ctrl-C interrupted the program, but it had to be killed
>> to stop, disappeared. I can fix the script that I sent in message [1]
>> and provide it, if there is interest. (Currently I have fixed only the
>> version that is within sfepy).
> 
> 
> I know I'd be interested.  With your permission, it might make a nice
> example as well.

Permission granted :) I have sent the script in response to William.

r.

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 2 simple ??: program exit w/graph, update graph real-time

2009-05-06 Thread Robert Cimrman

william ratcliff wrote:

I'd like to see it ;>


Here you are...

r.
import time
from multiprocessing import Process, Pipe
from Queue import Empty
import numpy as np
import pylab
import gobject

class ProcessPlotter(object):

def __init__(self):
self.x = []
self.y = []

def terminate(self):
pylab.close('all')

def poll_draw(self):

def call_back():
while 1:
if not self.pipe.poll():
break

command = self.pipe.recv()

if command is None:
self.terminate()
return False

else:
self.x.append(command[0])
self.y.append(command[1])
self.ax.plot(self.x, self.y, 'ro')

self.fig.canvas.draw()
return True

return call_back

def __call__(self, pipe):
print 'starting plotter...'

self.pipe = pipe
self.fig = pylab.figure()

self.ax = self.fig.add_subplot(111)
self.gid = gobject.timeout_add(1000, self.poll_draw())

print '...done'
pylab.show()


class NBPlot(object):
def __init__(self):
self.plot_pipe, plotter_pipe = Pipe()
self.plotter = ProcessPlotter()
self.plot_process = Process(target = self.plotter,
args = (plotter_pipe,))
self.plot_process.daemon = True
self.plot_process.start()

def plot(self, finished=False):
send = self.plot_pipe.send
if finished:
send(None)
else:
data = np.random.random(2)
send(data)

def main():
pl = NBPlot()
for ii in xrange(10):
pl.plot()
time.sleep(0.5)
raw_input('press Enter...')
pl.plot(finished=True)

if __name__ == '__main__':
main()
--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 2 simple ??: program exit w/graph, update graph real-time

2009-05-07 Thread Robert Cimrman

Ryan May wrote:

On Wed, May 6, 2009 at 8:53 AM, Robert Cimrman  wrote:


Ryan May wrote:


On Wed, May 6, 2009 at 7:57 AM, Robert Cimrman 
wrote:


Just for the record: Ryan May's example in this thread, that uses pipes,
inspired me to try pipes as well, instead of queues
(multiprocessing.Pipe instead of Queue) and the "hanging problem", i.e.
the problem that Ctrl-C interrupted the program, but it had to be killed
to stop, disappeared. I can fix the script that I sent in message [1]
and provide it, if there is interest. (Currently I have fixed only the
version that is within sfepy).



I know I'd be interested.  With your permission, it might make a nice
example as well.


Permission granted :) I have sent the script in response to William.



Done.  I like the fact that with your example, everything is self-contained
in a single script.


Exactly, the details of starting another python process are hidden, the 
multiprocessing module is really nice.


You might want to add

import matplotlib
matplotlib.use('GtkAgg')

to the script, and remove "from Queue import Empty".

FYI: I am sending also a more complex example - a Log class used in 
sfepy, which supports multiple subplots, labels, logarithmic plots etc. 
The file contains some other support classes too, so that it works 
standalone. It is not very polished, but it serves its purpose.


r.



import matplotlib
matplotlib.use('GtkAgg')

import numpy as nm
from multiprocessing import Process, Pipe
from matplotlib.ticker import LogLocator, AutoLocator
import pylab
import gobject

def get_default( arg, default, msg_if_none = None ):

if arg is None:
out = default
else:
out = arg

if (out is None) and (msg_if_none is not None):
raise ValueError( msg_if_none )

return out

class Struct( object ):
def __init__( self, **kwargs ):
if kwargs:
self.__dict__.update( kwargs )

def __str__( self ):
"""Print instance class, name and items in alphabetical order."""
ss = "%s" % self.__class__.__name__
if hasattr( self, 'name' ):
ss += ":%s" % self.name
ss += '\n'

keys, vals = self.__dict__.keys(), self.__dict__.values()
order = nm.argsort(keys)
for ii in order:
key, val = keys[ii], vals[ii]

if issubclass( val.__class__, Struct ):
ss += "  %s:\n%s" % (key, val.__class__.__name__)
if hasattr( val, 'name' ):
ss += ":%s" % val.name
ss += '\n'
else:
aux = "\n" + str( val )
aux = aux.replace( "\n", "\n" );
ss += "  %s:\n%s\n" % (key, aux[1:])
return( ss.rstrip() )

def __repr__( self ):
ss = "%s" % self.__class__.__name__
if hasattr( self, 'name' ):
ss += ":%s" % self.name
return ss

class Output( Struct ):
"""Factory class providing output (print) functions.

Example:

>>> output = Output( 'sfepy:' )
>>> output( 1, 2, 3, 'hello' )
>>> output.prefix = 'my_cool_app:'
>>> output( 1, 2, 3, 'hello' )
"""

def __init__(self, prefix, filename=None, combined=False, **kwargs):
Struct.__init__(self, **kwargs)

self.prefix = prefix

self.set_output(filename, combined)

def __call__(self, *argc, **argv):
self.output_function(*argc, **argv)

def set_output(self, filename=None, combined=False, append=False):
"""Set the output function - all SfePy printing is accomplished by
it. If filename is None, output is to screen only, otherwise it is to
the specified file, moreover, if combined is True, both the ways are
used.

Arguments:
filename - print into this file
combined - print both on screen and into a file
append - append to an existing file instead of overwriting it
"""
self.level = 0
def output_screen( *argc, **argv ):
format = '%s' + ' %s' * (len( argc ) - 1)
msg =  format % argc

if msg.startswith( '...' ):
self.level -= 1

print self._prefix + ('  ' * self.level) + msg

if msg.endswith( '...' ):
self.level += 1

def output_file( *argc, **argv ):
format = '%s' + ' %s' * (len( argc ) - 1)
msg =  format % argc

if msg.startswith( '...' ):
self.level -= 1

  

Re: [Matplotlib-users] 2 simple ??: program exit w/graph, update graph real-time

2009-05-07 Thread Robert Cimrman
Ryan May wrote:
> On Thu, May 7, 2009 at 12:39 PM, Eric Firing  wrote:
> 
>> In case you are not receiving the automatic svn commit messages: yesterday
>> I took the liberty of renaming log.py to multiprocess.py, because as far as
>> I could see the former gave no clue as to the point of the example.  Feel
>> free to change it back, or change it to something else, if you think I am
>> mistaken or confused about this.
> 
> 
> No, I think that is a much better name in terms of why that demo exists in
> matplotlib.  It was only in my haste to commit it that I didn't think about
> renaming it.

Yes, it is a better name.

Of course, you can also add the log2.py script to the matplotlib example 
s(renamed to multiprocess_complex.py?) if you wish.

cheers,
r.

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plot a triangular mesh

2009-05-23 Thread Robert Kern
On 2009-05-23 17:17, Eric Carlson wrote:
> I should read entire posts before sending people down the wrong
> pathways. I just happened to be working on a Python equivalent to MATLAB
> "triplot" stuff when I read your subject line and made the wrong
> assumptions. That program does just plot the edges, as you noted.
>
> I have attached a python program, much of which is a translation of a
> program I found at M*B central, contributed from the outside. Given a
> triangulation, it allows you to interpolate on a regular rectangular
> grid (dx=constant, dy=another constant). In your case, it should allow
> you to use your original triangulation, and should avoid the convex hull
> artifacts of your original griddata plot. I do not know if this new
> program will give you a figure that will look as good as your latest
> based on John's suggestion or not.

delaunay has a linear interpolator implemented in C++ that could be used for 
this purpose, too. The natural neighbor interpolator is only for Delaunay 
triangulations, but the linear interpolator should be usable for general 
triangulations.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plot a triangular mesh

2009-05-25 Thread Robert Cimrman
Ondrej Certik wrote:
> On Fri, May 22, 2009 at 3:37 PM, Ondrej Certik  wrote:
>> Thanks a lot John. I tried that and it does what I want. I just need
>> to convert and probably average my 3 different values at the 3
>> vertices of the triangle and color the triangle with that color. When
>> I get it working, I'll send you a picture. :)
> 
> Ok, I made a progress, it seems it's working. Script and picture
> attached. You can compare to the mayavi plot above, it's almost
> identical now. It took my some time playing with different parameters
> of mpl to get here and I think it looks quite good. Still one can see
> the artefacts though as John predicted, due to mpl not interpolating
> the triangles.

Nice!

Just to prod you a bit: If you want to get rid of the hard mayavi 
dependence of femhub for 3D plots too, you could hack a 
(perspective/whatever) projection of 3D surface to 2D, remove invisible 
faces (normal points backwards) and plot the rest by the painter's 
algorithm (far faces first).

r.

--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plot a triangular mesh

2009-05-26 Thread Robert Kern
On 2009-05-23 21:35, Eric Carlson wrote:
> Hello Robert,
> I studied delaunay and mlab.griddata a bit while converting tinterp and
> saw the
>
> """
>   tri = delaunay.Triangulation(x,y)
>   # interpolate data
>   interp = tri.nn_interpolator(z)
>   zo = interp(xi,yi)
> """
> stuff. In studying delaunay, however, it was/is not clear to me how to
> set up the "triangulation" for
>
> delaunay.LinearInterpolator(triangulation, z, default_value=-1.#IND)
>
> without going through delaunay. Any chance you could give an example of
> using delaunay to linearly interpolate on mesh x,y assuming data_pts,
> triangles, f_at_data_points are already given?

Hmm, true. I violated my own principle of trying not to do too much in the 
constructor. However, you should be able to figure out how to use the 
underlying 
utility functions compute_planes() and linear_interpolate_grid() from the 
LinearInterpolator code and Triangulation's docstring to describe its 
attributes.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] missing library animation from enthought distribution

2011-11-22 Thread Robert Kern
On 11/22/11 9:40 AM, andrei barcaru wrote:
> Hello
> My name is Andrew and I'm working in University of Gerona, Spain. I've 
> installed
> the entought distribution package on UBUNTU 11 32b OS . During the install I 
> was
> asked by the shell if I want to create a folder .. so I did that, I've 
> created a
> folder named pyth. Now .. when I'm trying to import matplotlib.animation as
> animation for instance .. I get an error that the module animation is missing 
> .
> And indeed in pyth/lib/python2.7/site-package/matplotlib/ there is no file 
> named
> animation
> Can you tell me please how can I update matplotlib to get the animation 
> package
> installed.

The current version of EPD contains matplotlib 1.0.1. The animation package was 
added in matplotlib 1.1.0.

To get matplotlib 1.1.0 right now, you will have to build it yourself from 
sources. You can remove EPD's matplotlib 1.0.1 like so:

$ enpkg --remove matplotlib

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] cannot import animation module

2011-11-23 Thread Robert Kern
On 11/23/11 9:49 AM, Chao YUE wrote:
> Dear all,
>
> I am using matplotlib 0.99.3 (I think it's the default version when I use sudo
> apt-get install under ubuntu 11.04), but I don't have matplotlib.animation
> module. I think I need to reinstall it?

The animation module was added in matplotlib 1.1.0. You will have to install 
that version instead.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to keep only the x first terms of an array(numpy)?

2012-01-30 Thread Robert Kern
On 1/30/12 3:50 PM, Fabien Lafont wrote:
> Hello,
>
> Do somebody knows how to keep only the x first terms of a numpy 1D array?
>
> like
>
> a = array([8,4,5,7,9])
> function(a,2)
>>>> [8,4]

These questions belong on the numpy mailing list. You have already asked this 
question on scipy-user and received a correct answer.

   http://www.scipy.org/Mailing_Lists

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] easy_install in virtualenv -- error: command 'gcc' failed with exit status 1

2010-06-07 Thread Robert Sudwarts
Hi,

Hoping someone can help with this... I'm trying to install in a virtual
environment created with "--no-site-packages"
I've followed all instructions re cleaning the existing .matplotlib
cache/directory and deleted .egg files etc

(virtualenv) ... $ easy_install matplotlib  -- gives me an error: "command
'gcc' failed with exit status 1"

The existing components (note: all from within the virtualenv):

$ python --version  --> 2.6.4

$ python -c 'import numpy; print numpy.__version__'-->   1.4.1

$ gcc --version  --> 4.4.1

$ uname -a  -->  Linux HP-desktop 2.6.31-22-generic-pae #60-Ubuntu SMP
Thu May 27 01:40:15 UTC 2010 i686 GNU/Linux

(I'm running this on Ubuntu Karmic Koala -- please note that installing from
the Synaptic Package Manager gives me a working version which runs correctly
and as expected, using  ipython -pylab etc)

This may be a question of downloading a version other than v0.99.3 but in
that case I'd not be sure which one to use(!)
I'd be really grateful for any assistance you can give



(and finally the output/error from "easy_install matplotlib")

Searching for matplotlib
Reading http://pypi.python.org/simple/matplotlib/
Reading http://matplotlib.sourceforge.net
Reading
http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474
Reading
https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=278194
Reading http://sourceforge.net/project/showfiles.php?group_id=80706
Reading
https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.1/
Reading
https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474
Best match: matplotlib 0.99.3
Downloading
http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.3/matplotlib-0.99.3.tar.gz/download
Processing download
Running matplotlib-0.99.3/setup.py -q bdist_egg --dist-dir
/tmp/easy_install-7FYGk8/matplotlib-0.99.3/egg-dist-tmp-7gnrbR

BUILDING MATPLOTLIB
matplotlib: 0.99.3
python: 2.6.4 (r264:75706, Dec  7 2009, 18:45:15)  [GCC
4.4.1]
  platform: linux2

REQUIRED DEPENDENCIES
 numpy: 1.4.1
 freetype2: found, but unknown version (no pkg-config)
* WARNING: Could not find 'freetype2' headers in any
* of '/usr/local/include', '/usr/include', '.',
* '/usr/local/include/freetype2',
* '/usr/include/freetype2', './freetype2'.

OPTIONAL BACKEND DEPENDENCIES
libpng: found, but unknown version (no pkg-config)
* Could not find 'libpng' headers in any of
* '/usr/local/include', '/usr/include', '.'
   Tkinter: no
* Using default library and include directories for
* Tcl and Tk because a Tk window failed to open.
* You may need to define DISPLAY for Tk to work so
* that setup can determine where your libraries are
* located. Tkinter present, but header files are not
* found. You may need to install development
* packages.
  wxPython: no
* wxPython not found
  Gtk+: no
* Building for Gtk+ requires pygtk; you must be able
* to "import gtk" in your build/install environment
   Mac OS X native: no
Qt: no
   Qt4: no
 Cairo: no

OPTIONAL DATE/TIMEZONE DEPENDENCIES
  datetime: present, version unknown
  dateutil: matplotlib will provide
  pytz: matplotlib will provide
adding pytz

OPTIONAL USETEX DEPENDENCIES
dvipng: no
   ghostscript: 8.70
 latex: no
   pdftops: 0.12.0

[Edit setup.cfg to suppress the above messages]

pymods ['pylab']
packages ['matplotlib', 'matplotlib.backends', 'matplotlib.projections',
'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid',
'matplotlib.sphinxext', 'matplotlib.numerix', 'matplotlib.numerix.mlab', '
matplotlib.numerix.ma', 'matplotlib.numerix.linear_algebra',
'matplotlib.numerix.random_array', 'matplotlib.numerix.fft',
'matplotlib.delaunay', 'pytz', 'dateutil', 'dateutil/zoneinfo']
warning: no files found matching 'MANIFEST'
warning: no files found matching 'lib/mpl_toolkits'
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for
Ada/C/ObjC but not for C++
In file included from /usr/include/c++/4.4/ext/hash_map:59,
 from ./CXX/Extensions.hxx:68,
 from src/ft2font.h:4,
 from src/ft2font.cpp:1:
/usr/include/c++/4.4/backward/backward_warning.h:

Re: [Matplotlib-users] easy_install in virtualenv -- error: command 'gcc' failed with exit status 1

2010-06-07 Thread Robert Sudwarts
Thanks for your quick response Eric -- I've just spotted the freetype &
libpng packages which will also need to be installed...

... and having downloaded freetype etc (and seen its rather interesting
installation instructions...) I'll have to figure out how to get this to end
up in the right place!

Thanks for your help.

Rob







On 8 June 2010 00:15, Robert Sudwarts  wrote:

> Hi,
>
> Hoping someone can help with this... I'm trying to install in a virtual
> environment created with "--no-site-packages"
> I've followed all instructions re cleaning the existing .matplotlib
> cache/directory and deleted .egg files etc
>
> (virtualenv) ... $ easy_install matplotlib  -- gives me an error: "command
> 'gcc' failed with exit status 1"
>
> The existing components (note: all from within the virtualenv):
>
> $ python --version  --> 2.6.4
>
> $ python -c 'import numpy; print numpy.__version__'-->   1.4.1
>
> $ gcc --version  --> 4.4.1
>
> $ uname -a  -->  Linux HP-desktop 2.6.31-22-generic-pae #60-Ubuntu SMP
> Thu May 27 01:40:15 UTC 2010 i686 GNU/Linux
>
> (I'm running this on Ubuntu Karmic Koala -- please note that installing
> from the Synaptic Package Manager gives me a working version which runs
> correctly and as expected, using  ipython -pylab etc)
>
> This may be a question of downloading a version other than v0.99.3 but in
> that case I'd not be sure which one to use(!)
> I'd be really grateful for any assistance you can give
>
>
>
> (and finally the output/error from "easy_install matplotlib")
>
> Searching for matplotlib
> Reading http://pypi.python.org/simple/matplotlib/
> Reading http://matplotlib.sourceforge.net
> Reading
> http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474
> Reading
> https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=278194
> Reading http://sourceforge.net/project/showfiles.php?group_id=80706
> Reading
> https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.1/
> Reading
> https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474
> Best match: matplotlib 0.99.3
> Downloading
> http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.3/matplotlib-0.99.3.tar.gz/download
> Processing download
> Running matplotlib-0.99.3/setup.py -q bdist_egg --dist-dir
> /tmp/easy_install-7FYGk8/matplotlib-0.99.3/egg-dist-tmp-7gnrbR
>
> 
> BUILDING MATPLOTLIB
> matplotlib: 0.99.3
> python: 2.6.4 (r264:75706, Dec  7 2009, 18:45:15)  [GCC
> 4.4.1]
>   platform: linux2
>
> REQUIRED DEPENDENCIES
>  numpy: 1.4.1
>  freetype2: found, but unknown version (no pkg-config)
> * WARNING: Could not find 'freetype2' headers in
> any
> * of '/usr/local/include', '/usr/include', '.',
> * '/usr/local/include/freetype2',
> * '/usr/include/freetype2', './freetype2'.
>
> OPTIONAL BACKEND DEPENDENCIES
> libpng: found, but unknown version (no pkg-config)
> * Could not find 'libpng' headers in any of
> * '/usr/local/include', '/usr/include', '.'
>Tkinter: no
> * Using default library and include directories for
>  * Tcl and Tk because a Tk window failed to open.
> * You may need to define DISPLAY for Tk to work so
> * that setup can determine where your libraries are
> * located. Tkinter present, but header files are
> not
> * found. You may need to install development
> * packages.
>   wxPython: no
> * wxPython not found
>   Gtk+: no
> * Building for Gtk+ requires pygtk; you must be
> able
> * to "import gtk" in your build/install environment
>Mac OS X native: no
> Qt: no
>Qt4: no
>  Cairo: no
>
> OPTIONAL DATE/TIMEZONE DEPENDENCIES
>   datetime: present, version unknown
>   dateutil: matplotlib will provide
>   pytz: matplotlib will provide
> adding pytz
>
> OPTIONAL USETEX 

[Matplotlib-users] virtualenv installation: ImportError: No module named _tkagg

2010-06-09 Thread Robert Sudwarts
Hi,

I've installed matplotlib in a virtual environment but am having a problem
with generating a plot.
I've tried to run a "simple_plot.py" both as a script and from within the
ipython/python shell.

I've changed the backend in
virtualenvs/.../lib/python2.6/site-packages/matplotlig/mpl-data/matplotlibrc
to: "backend  : TkAgg"

from the within the virtualenv (regular python) shell I can:
>>> import _tkinter
>>> import Tkinter
>>> Tkinter._test()
(and the test window opens as expected)

My virtualenv sys.path includes:
"/home/virtualenvs/.../lib/python2.6/lib-tk'

When I try to use ipython -pylab (or run a script) I'm getting an error:

  import _tkagg
ImportError: No module named _tkagg

I'm assuming that there's a relatively simple fix for this related to the
"matplotlibrc" backend but can't for the life of me work out how to get it
fixed.   I'd be grateful for any help.

Many thanks,
Rob
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] virtualenv installation: ImportError: No module named _tkagg

2010-06-09 Thread Robert Sudwarts
Thanks to both of you for your replies.

I should have included the info that I've tried to build matplotlib using
virtualenv with the --no-site-packages option.

... And in the meantime, I have an existing (and working) build, courtesy of
the Ubuntu package manager.

Seeing as the package manager version is working, I'm going to scrub
everything that I currently have (including any build directories which have
been created along the way) and start from scratch... I'll let you know if
that works!!

Thanks again,
Rob





On 9 June 2010 18:26, Benjamin Root  wrote:

> I don't know if this is the same issue that I had once, but I will just
> throw it out there.  Once I compiled matplotlib myself before
> double-checking that I had all the needed development files and so the build
> process didn't produce all the files for tkagg and used GTKAgg instead.  I
> had to get all the needed development packages and completely clean out my
> build directory and rebuild matplotlib before it would work properly.
>
> Ben Root
>
> On Wed, Jun 9, 2010 at 9:47 AM, Robert Sudwarts  > wrote:
>
>> Hi,
>>
>> I've installed matplotlib in a virtual environment but am having a problem
>> with generating a plot.
>> I've tried to run a "simple_plot.py" both as a script and from within the
>> ipython/python shell.
>>
>> I've changed the backend in
>> virtualenvs/.../lib/python2.6/site-packages/matplotlig/mpl-data/matplotlibrc
>> to: "backend  : TkAgg"
>>
>> from the within the virtualenv (regular python) shell I can:
>> >>> import _tkinter
>> >>> import Tkinter
>> >>> Tkinter._test()
>> (and the test window opens as expected)
>>
>> My virtualenv sys.path includes:
>> "/home/virtualenvs/.../lib/python2.6/lib-tk'
>>
>> When I try to use ipython -pylab (or run a script) I'm getting an error:
>>
>>   import _tkagg
>> ImportError: No module named _tkagg
>>
>> I'm assuming that there's a relatively simple fix for this related to the
>> "matplotlibrc" backend but can't for the life of me work out how to get it
>> fixed.   I'd be grateful for any help.
>>
>> Many thanks,
>> Rob
>>
>>
>>
>>
>> --
>> ThinkGeek and WIRED's GeekDad team up for the Ultimate
>> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
>> lucky parental unit.  See the prize list and enter to win:
>> http://p.sf.net/sfu/thinkgeek-promo
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] virtualenv installation: ImportError: No module named _tkagg

2010-06-09 Thread Robert Sudwarts
Some success!

I think my lack of understanding of how virtualenv (and dist- vs
site-packages) actually works is to blame...  The  "--no-site-packages" flag
does what it says on the tin and the dist-packages are available whether or
not this option is used

Hence, no need (in my case) to build matplotlib in the virtualenv ...





On 9 June 2010 19:06, Robert Sudwarts  wrote:

> Thanks to both of you for your replies.
>
> I should have included the info that I've tried to build matplotlib using
> virtualenv with the --no-site-packages option.
>
> ... And in the meantime, I have an existing (and working) build, courtesy
> of the Ubuntu package manager.
>
> Seeing as the package manager version is working, I'm going to scrub
> everything that I currently have (including any build directories which have
> been created along the way) and start from scratch... I'll let you know if
> that works!!
>
> Thanks again,
> Rob
>
>
>
>
>
> On 9 June 2010 18:26, Benjamin Root  wrote:
>
>> I don't know if this is the same issue that I had once, but I will just
>> throw it out there.  Once I compiled matplotlib myself before
>> double-checking that I had all the needed development files and so the build
>> process didn't produce all the files for tkagg and used GTKAgg instead.  I
>> had to get all the needed development packages and completely clean out my
>> build directory and rebuild matplotlib before it would work properly.
>>
>> Ben Root
>>
>> On Wed, Jun 9, 2010 at 9:47 AM, Robert Sudwarts <
>> robert.sudwa...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I've installed matplotlib in a virtual environment but am having a
>>> problem with generating a plot.
>>> I've tried to run a "simple_plot.py" both as a script and from within the
>>> ipython/python shell.
>>>
>>> I've changed the backend in
>>> virtualenvs/.../lib/python2.6/site-packages/matplotlig/mpl-data/matplotlibrc
>>> to: "backend  : TkAgg"
>>>
>>> from the within the virtualenv (regular python) shell I can:
>>> >>> import _tkinter
>>> >>> import Tkinter
>>> >>> Tkinter._test()
>>> (and the test window opens as expected)
>>>
>>> My virtualenv sys.path includes:
>>> "/home/virtualenvs/.../lib/python2.6/lib-tk'
>>>
>>> When I try to use ipython -pylab (or run a script) I'm getting an error:
>>>
>>>   import _tkagg
>>> ImportError: No module named _tkagg
>>>
>>> I'm assuming that there's a relatively simple fix for this related to the
>>> "matplotlibrc" backend but can't for the life of me work out how to get it
>>> fixed.   I'd be grateful for any help.
>>>
>>> Many thanks,
>>> Rob
>>>
>>>
>>>
>>>
>>> --
>>> ThinkGeek and WIRED's GeekDad team up for the Ultimate
>>> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
>>> lucky parental unit.  See the prize list and enter to win:
>>> http://p.sf.net/sfu/thinkgeek-promo
>>> ___
>>> Matplotlib-users mailing list
>>> Matplotlib-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>
>
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] how to plot the empirical cdf of an array?

2010-07-09 Thread Robert Kern
On 7/9/10 10:02 AM, per freem wrote:
> I'd like to clarify: I want the empirical cdf, but I want it to be
> normalized.  There's a normed=True option to plt.hist but how can I do
> the equivalent for CDFs?

There is no such thing as a normalized empirical CDF. Or rather, there is no 
such thing as an unnormalized empirical CDF.

Alan's code is good. Unless if you have a truly staggering number of points, 
there is no reason to bin the data first.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] how to plot the empirical cdf of an array?

2010-07-09 Thread Robert Kern
On 7/9/10 10:31 AM, per freem wrote:
> Also, I am not sure how to use alan's code.
>
> If I try:
>
> ec = empirical_cdf(my_data)
> plt.plot(ec)
>
> it doesn't actually look like a cdf

Make sure my_data is sorted first.

plt.plot(my_data, ec)

You probably want to use one of the "steps" linestyles; I'm not sure which one 
would be best. It probably doesn't matter much.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] problem with twinx and autofmt_xdate

2010-07-14 Thread Robert Hancock
Hi

I am trying to use autofmt_xdate() on graphs with more than 1 y-axis. But it
seems that even calling twinx() causes errors. On python 2.5 matplotlib 0.98
a call to twinx() seems to switch off the functioning of autofmt_xdate()
(and the labels are horizontal and mashed up). On python 2.6 and matplotlib
1.0.0 it causes a ValueError.

The following script illustrates the issue (in real life I obviously want to
do things with ax2, but it seems that even creating it causes problems). Is
there a simple working example of rotated data formats and twinx()?

robert

import datetime
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

date=[datetime.datetime(2010,1,1), datetime.datetime(2010,12,1)]
data=[1,2]

fig = plt.figure()
ax = fig.add_subplot(111)
# uncommenting the following line will lead to the problems
# ax2=ax.twinx()
ax.plot(date, data)

fig.autofmt_xdate(rotation=90)

fig.savefig("test3.png", dpi=400)


--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] CMYK images

2010-08-26 Thread Robert Kern
On 8/26/10 3:26 PM, Fernando Perez wrote:
> On Thu, Aug 26, 2010 at 11:39 AM, Eric Firing  wrote:
>> It's not trivial.  This might help:
>>
>> http://www.littlecms.com/
>>
>> See the tutorial for some nice background info.
>
> And this could be a good start for a python-based workflow:
>
> http://www.cazabon.com/pyCMS/
>
> *if* it works (it looks old, so it may have bit-rotted in the meantime).
>
> Another option would be to ctypes-wrap the calls of littleCMS one
> needs just for this and be done with it.  Not very elegant, but it
> might get the OP out of a bind with minimal work, and he'd have a
> little eps2cmyk.py script he could run on his MPL-generated EPS files
> for colorspace conversion.  Just an afternoon hack.  :)

You can also use my numpy-aware wrappers:

   http://www.enthought.com/~rkern/cgi-bin/hgwebdir.cgi/lcms/

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] 3d plot without marker edge

2010-10-15 Thread Robert Fenwick

Hi, 

I have a 3d plot that I am trying to plot and I can not get rid of the marker 
edge. an example would help

Bryn






--
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib.delauney with periodic boundary conditions

2010-10-22 Thread Robert Kern
On 10/22/10 6:28 AM, Matthew Matic wrote:
>
> I'm trying to get a delaunay triangulation of a set of points on the surface
> of the torus. I'm using matplotlib.delaunay, but it seems to only give the
> triangulation for a flat surface. Is there any way to tell it to take the
> periodic boundary conditions into account, or alter the points I input such
> that matplotlib.delaunay interprets them as being on the surface of the
> torus.

No, there isn't.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib.delauney with periodic boundary conditions

2010-10-22 Thread Robert Kern
On 10/22/10 6:28 AM, Matthew Matic wrote:
>
> I'm trying to get a delaunay triangulation of a set of points on the surface
> of the torus. I'm using matplotlib.delaunay, but it seems to only give the
> triangulation for a flat surface. Is there any way to tell it to take the
> periodic boundary conditions into account, or alter the points I input such
> that matplotlib.delaunay interprets them as being on the surface of the
> torus.

Having said that, assuming your points are reasonably dense, then you can 
simply 
repeat your points 9 (or 25) times in a tiled grid, then pull out the center. 
That's probably close enough. There's some bookkeeping left as an exercise for 
the reader, but it's nothing unreasonable.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Possible memory leak?

2010-11-18 Thread Robert Kern
On 11/18/10 5:05 PM, John Hunter wrote:
> On Thu, Nov 18, 2010 at 2:20 PM, Benjamin Root  wrote:
>
>> Interesting analysis.  One possible source of a leak would be some sort of
>> dangling reference that still hangs around even though the plot objects have
>> been cleared.  By the time of the matplotlib 1.0.0 release, we did seem to
>> clear out pretty much all of these, but it is possible there are still some
>> lurking about.  We should probably run your script against the latest svn to
>> see how the results compare.
>
> In our experience, many of the GUI backends have some leak, and these
> are in the GUI and not in mpl.  Caleb, can you see if you can
> replicate the leak with your example code using the agg backend (no
> GUI).  If so, could you post the code that exposes the leak.  if not,
> I'm afraid it is in wx and you might need to deal with the wx
> developers.

Heh. Good timing! I just fixed a bug in Chaco involving a leaking cycle that 
the 
garbage collector could not clean up. The lesson of my tale of woe is that even 
if there is no leak when you run without wxPython, that doesn't mean that 
wxPython is the culprit.

If any object in the connected graph containing a cycle (even if it does not 
directly participate in the cycle) has an __del__ method in pure Python, then 
the garbage collector will not clean up that cycle for safety reasons. Read the 
docs for the gc module for details. We use SWIG to wrap Agg and SWIG adds 
__del__ methods for all of its classes. wxPython uses SWIG and has the same 
problems. If there is a cycle which can reach a wxPython object, the cycle will 
leak. The actual cycle may be created by matplotlib, though.

You can determine if this is the case pretty easily, though. Call gc.collect() 
then examine the list gc.garbage. This will contain all of those objects with a 
__del__ that prevented a cycle from being collected.

I recommend using objgraph to diagram the graph of references to those objects. 
It's invaluable to actually see what's going on.

   http://pypi.python.org/pypi/objgraph

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco


--
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] pylab

2010-11-26 Thread robert fujii
Hello - I am using python 2.6, numpy-1.3.0-win32-
superpack-python2.6, scipy-0.7.1-win32-superpack-python2.6,
sympy-0.6.7.win32,
matplotlib-1.0.0.win32-py2.6,  and brian-1.2.1.win32.
I would like to "import pylab" , however I get the following messages
shown below.  Any assistnce would be highly appreciated.
Thank you.
Robert
*
import pylab
  File "F:\Python26\lib\site-packages\pylab.py", line 1, in 
from matplotlib.pylab import *
  File "F:\Python26\lib\site-packages\matplotlib\pylab.py", line 206, in

from matplotlib import mpl  # pulls in most modules
  File "F:\Python26\lib\site-packages\matplotlib\mpl.py", line 2, in

from matplotlib import axis
  File "F:\Python26\lib\site-packages\matplotlib\axis.py", line 10, in

import matplotlib.font_manager as font_manager
  File "F:\Python26\lib\site-packages\matplotlib\font_manager.py", line
1301, in 
_rebuild()
  File "F:\Python26\lib\site-packages\matplotlib\font_manager.py", line
1292, in _rebuild
fontManager = FontManager()
  File "F:\Python26\lib\site-packages\matplotlib\font_manager.py", line 984,

in __init__
self.ttffiles = findSystemFonts(paths) + findSystemFonts()
  File "F:\Python26\lib\site-packages\matplotlib\font_manager.py", line 330,

in findSystemFonts
for f in win32InstalledFonts(fontdir):
  File "F:\Python26\lib\site-packages\matplotlib\font_manager.py", line 213,

in win32InstalledFonts
key, direc, any = _winreg.EnumValue( local, j)
MemoryError
--
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] image conversion

2010-12-16 Thread Robert Field
Newbie here, and trying to wade through this stuff, and it's not coming too 
quickly.  I'm just trying to take svg data I already have and turn it around 
into png/pdf/jpg files.  Surely this is not terribly difficult. Any help 
appreciated!
--
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] image conversion

2010-12-16 Thread Robert Field
That's what I thought at first too, but imagemagick/graphicsmagick aren't able 
to do the work. I've found something else to use in the meantime.  Thanks,
Rob

On Dec 16, 2010, at 8:59 PM, Benjamin Root wrote:

> On Friday, December 10, 2010, Robert Field  wrote:
>> Newbie here, and trying to wade through this stuff, and it's not coming too 
>> quickly.  I'm just trying to take svg data I already have and turn it around 
>> into png/pdf/jpg files.  Surely this is not terribly difficult. Any help 
>> appreciated!
>> --
>> Lotusphere 2011
>> Register now for Lotusphere 2011 and learn how
>> to connect the dots, take your collaborative environment
>> to the next level, and enter the era of Social Business.
>> http://p.sf.net/sfu/lotusphere-d2d
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
> Matplotlib is probably not what you want.  For rasterized conversions,
> there is ImageMagick.  Most Linux distros come with 'convert' that you
> can use at the command line. Inkscape is good for visual editing of
> vector data.
> 
> HTH!
> Ben Root


--
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] image conversion

2010-12-17 Thread Robert Field
Ah, imagemagick/graphicsmagick couldn't successfully parse svg, so no 
conversion was possible. I wound up looking at batik, a java-based solution, 
which is not fast, but has the benefit of actually working.  

--Rob

On Dec 17, 2010, at 3:11 PM, Alan G Isaac wrote:

> On 12/17/2010 12:24 AM, Robert Field wrote:
>> imagemagick/graphicsmagick aren't able to do the work. I've found something 
>> else to use in the meantime.
> 
> It would not be off topic to share your solution with the list.
> 
> Alan Isaac
> 


--
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Python 3

2010-12-23 Thread Robert Young
Hi,  I have used Matplotlib extensively now for 2 years with python 2.x.
I recently needed to move to python 3.1 which was greatly facilitated by
numpy and scipy being ported to python 3.  I was lucky in that all I
have to change is many print statements.  All on a Windows OS.

 

But my progress is severely limited by having no port of Matplotlib to
python 3.  I am definitely a user so have contributed twice to
Matplotlib development.

 

Plea:  If the stars align properly, I would be so grateful for a port of
matplotlib to python 3.

 

Thanks for hearing me.

 

 

--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Python 3

2010-12-23 Thread Robert Young
Thank you for your fast reply and suggestion.   I downloaded the GNU tar
ball and looked at it.  Unfortunately due to my own limitations, I need
a win32 installer.
I'll have to bide my time I guess.

RDY

-Original Message-
From: Christoph Gohlke [mailto:cgoh...@uci.edu] 
Sent: Thursday, December 23, 2010 2:47 PM
To: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] Python 3



On 12/23/2010 1:01 PM, Robert Young wrote:
> Hi, I have used Matplotlib extensively now for 2 years with python
2.x.
> I recently needed to move to python 3.1 which was greatly facilitated
by
> numpy and scipy being ported to python 3. I was lucky in that all I
have
> to change is many print statements. All on a Windows OS.
>
> But my progress is severely limited by having no port of Matplotlib to
> python 3. I am definitely a user so have contributed twice to
Matplotlib
> development.
>
> Plea: If the stars align properly, I would be so grateful for a port
of
> matplotlib to python 3.
>
> Thanks for hearing me.
>

Did you try the py3k branch at 
<http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/branches/py3k/>
? It 
does work for simple plots.

--
Christoph


--
Learn how Oracle Real Application Clusters (RAC) One Node allows
customers
to consolidate database storage, standardize their database environment,
and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Trouble with imshow

2011-02-02 Thread Robert Abiad
Hello All,

I'm very new to python, so bear with me.

I'd like to use python to do my image processing, but I'm running into behavior 
that doesn't make 
sense to me.  I'm using Windows 7 Pro (64-bit) with 4 gigs of memory, python 
2.6.6, and the newest 
versions of ipython, pyfits, matplotlib (1.0.1), numpy (1.5.1), scipy.  I'm 
loading in a fits file 
that's 26 MB (~16 Mpixels).  When I load my image in ImageJ, I can see memory 
usage go up by 50MB, 
but when I try displaying the image using imshow(), my memory usage goes up by 
around 500MB, each 
time.  If I close the figure and replot it, imshow() crashes.  I don't know if 
I'm doing something 
wrong, or if it's a new or known bug.  I tried the same thing on Linux and got 
the same result. 
Here's a transcript.

   Welcome to pylab, a matplotlib-based Python environment.
   For more information, type 'help(pylab)'.

In [1]: import pyfits

In [2]: from Tkinter import *

In [3]: import tkFileDialog

In [4]: image=pyfits.getdata(tkFileDialog.askopenfilename())

In [5]: imshow(image)
Out[5]: 

In [6]: close()

In [7]: imshow(image,origin='lower')
Out[7]: 

In [8]: close()

In [9]: imshow(image[100:3600,100:3600],origin='lower')
Out[9]: 

In [10]: Exception in Tkinter callback
Traceback (most recent call last):
   File "C:\app\Python2.6\lib\lib-tk\Tkinter.py", line 1410, in __call__
 return self.func(*args)
   File "C:\app\Python2.6\lib\lib-tk\Tkinter.py", line 495, in callit
 func(*args)
   File 
"C:\app\Python2.6\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 
263, in 
idle_draw
 self.draw()
   File 
"C:\app\Python2.6\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 
248, in draw
 FigureCanvasAgg.draw(self)
   File 
"C:\app\Python2.6\lib\site-packages\matplotlib\backends\backend_agg.py", line 
394, in draw
 self.figure.draw(self.renderer)
   File "C:\app\Python2.6\lib\site-packages\matplotlib\artist.py", line 55, in 
draw_wrapper
 draw(artist, renderer, *args, **kwargs)
   File "C:\app\Python2.6\lib\site-packages\matplotlib\figure.py", line 798, in 
draw
 func(*args)
   File "C:\app\Python2.6\lib\site-packages\matplotlib\artist.py", line 55, in 
draw_wrapper
 draw(artist, renderer, *args, **kwargs)
   File "C:\app\Python2.6\lib\site-packages\matplotlib\axes.py", line 1946, in 
draw
 a.draw(renderer)
   File "C:\app\Python2.6\lib\site-packages\matplotlib\artist.py", line 55, in 
draw_wrapper
 draw(artist, renderer, *args, **kwargs)
   File "C:\app\Python2.6\lib\site-packages\matplotlib\image.py", line 354, in 
draw
 im = self.make_image(renderer.get_image_magnification())
   File "C:\app\Python2.6\lib\site-packages\matplotlib\image.py", line 569, in 
make_image
 transformed_viewLim)
   File "C:\app\Python2.6\lib\site-packages\matplotlib\image.py", line 201, in 
_get_unsampled_image
 x = self.to_rgba(self._A, self._alpha)
   File "C:\app\Python2.6\lib\site-packages\matplotlib\cm.py", line 193, in 
to_rgba
 x = self.norm(x)
   File "C:\app\Python2.6\lib\site-packages\matplotlib\colors.py", line 820, in 
__call__
 result = (val-vmin) / (vmax-vmin)
   File "C:\app\Python2.6\lib\site-packages\numpy\ma\core.py", line 3673, in 
__div__
 return divide(self, other)
   File "C:\app\Python2.6\lib\site-packages\numpy\ma\core.py", line 1077, in 
__call__
 m |= filled(domain(da, db), True)
   File "C:\app\Python2.6\lib\site-packages\numpy\ma\core.py", line 772, in 
__call__
 return umath.absolute(a) * self.tolerance >= umath.absolute(b)
MemoryError


Thanks for any help,
-robert

--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Trouble with imshow

2011-02-02 Thread Robert Abiad
On 2/2/2011 3:59 PM, Christoph Gohlke wrote:
> On 2/2/2011 3:33 PM, Robert Abiad wrote:
>> Hello All,
>>
>> I'm very new to python, so bear with me.
>>
>> I'd like to use python to do my image processing, but I'm running into 
>> behavior that doesn't make
>> sense to me.  I'm using Windows 7 Pro (64-bit) with 4 gigs of memory, python 
>> 2.6.6, and the newest
>> versions of ipython, pyfits, matplotlib (1.0.1), numpy (1.5.1), scipy.  I'm 
>> loading in a fits file
>> that's 26 MB (~16 Mpixels).  When I load my image in ImageJ, I can see 
>> memory usage go up by 50MB,
>> but when I try displaying the image using imshow(), my memory usage goes up 
>> by around 500MB, each
>> time.  If I close the figure and replot it, imshow() crashes.  I don't know 
>> if I'm doing something
>> wrong, or if it's a new or known bug.  I tried the same thing on Linux and 
>> got the same result.
>> Here's a transcript.
>>
>>  Welcome to pylab, a matplotlib-based Python environment.
>>  For more information, type 'help(pylab)'.
>>
>> In [1]: import pyfits
>>
>> In [2]: from Tkinter import *
>>
>> In [3]: import tkFileDialog
>>
>> In [4]: image=pyfits.getdata(tkFileDialog.askopenfilename())
>>
>> In [5]: imshow(image)
>> Out[5]:
>>
>> In [6]: close()
>>
>> In [7]: imshow(image,origin='lower')
>> Out[7]:
>>
>> In [8]: close()
>>
>> In [9]: imshow(image[100:3600,100:3600],origin='lower')
>> Out[9]:
>>
>> In [10]: Exception in Tkinter callback
>> Traceback (most recent call last):
>>  File "C:\app\Python2.6\lib\lib-tk\Tkinter.py", line 1410, in __call__
>>return self.func(*args)
>>  File "C:\app\Python2.6\lib\lib-tk\Tkinter.py", line 495, in callit
>>func(*args)
>>  File 
>> "C:\app\Python2.6\lib\site-packages\matplotlib\backends\backend_tkagg.py", 
>> line 263, in
>> idle_draw
>>self.draw()
>>  File 
>> "C:\app\Python2.6\lib\site-packages\matplotlib\backends\backend_tkagg.py", 
>> line 248, in draw
>>FigureCanvasAgg.draw(self)
>>  File 
>> "C:\app\Python2.6\lib\site-packages\matplotlib\backends\backend_agg.py", 
>> line 394, in draw
>>self.figure.draw(self.renderer)
>>  File "C:\app\Python2.6\lib\site-packages\matplotlib\artist.py", line 
>> 55, in draw_wrapper
>>draw(artist, renderer, *args, **kwargs)
>>  File "C:\app\Python2.6\lib\site-packages\matplotlib\figure.py", line 
>> 798, in draw
>>func(*args)
>>  File "C:\app\Python2.6\lib\site-packages\matplotlib\artist.py", line 
>> 55, in draw_wrapper
>>draw(artist, renderer, *args, **kwargs)
>>  File "C:\app\Python2.6\lib\site-packages\matplotlib\axes.py", line 
>> 1946, in draw
>>a.draw(renderer)
>>  File "C:\app\Python2.6\lib\site-packages\matplotlib\artist.py", line 
>> 55, in draw_wrapper
>>draw(artist, renderer, *args, **kwargs)
>>  File "C:\app\Python2.6\lib\site-packages\matplotlib\image.py", line 
>> 354, in draw
>>im = self.make_image(renderer.get_image_magnification())
>>  File "C:\app\Python2.6\lib\site-packages\matplotlib\image.py", line 
>> 569, in make_image
>>transformed_viewLim)
>>  File "C:\app\Python2.6\lib\site-packages\matplotlib\image.py", line 
>> 201, in _get_unsampled_image
>>x = self.to_rgba(self._A, self._alpha)
>>  File "C:\app\Python2.6\lib\site-packages\matplotlib\cm.py", line 193, 
>> in to_rgba
>>x = self.norm(x)
>>  File "C:\app\Python2.6\lib\site-packages\matplotlib\colors.py", line 
>> 820, in __call__
>>result = (val-vmin) / (vmax-vmin)
>>  File "C:\app\Python2.6\lib\site-packages\numpy\ma\core.py", line 3673, 
>> in __div__
>>return divide(self, other)
>>  File "C:\app\Python2.6\lib\site-packages\numpy\ma\core.py", line 1077, 
>> in __call__
>>m |= filled(domain(da, db), True)
>>  File "C:\app\Python2.6\lib\site-packages\numpy\ma\core.py", line 772, 
>> in __call__
>>return umath.absolute(a) * self.tolerance>= umath.absolute(b)
>> MemoryError
>>
>>
>> Thanks for any help,
>> -robert
>>
>
>
> These are previous d

Re: [Matplotlib-users] Trouble with imshow

2011-02-02 Thread Robert Abiad


On 2/2/2011 6:06 PM, Eric Firing wrote:
> On 02/02/2011 03:08 PM, Robert Abiad wrote:
>> On 2/2/2011 3:59 PM, Christoph Gohlke wrote:
>>> On 2/2/2011 3:33 PM, Robert Abiad wrote:
>>>> Hello All,
>>>>
>>>> I'm very new to python, so bear with me.
>>>>
>>>> I'd like to use python to do my image processing, but I'm running into 
>>>> behavior that doesn't make
>>>> sense to me.  I'm using Windows 7 Pro (64-bit) with 4 gigs of memory, 
>>>> python 2.6.6, and the newest
>>>> versions of ipython, pyfits, matplotlib (1.0.1), numpy (1.5.1), scipy.  
>>>> I'm loading in a fits file
>>>> that's 26 MB (~16 Mpixels).  When I load my image in ImageJ, I can see 
>>>> memory usage go up by 50MB,
>>>> but when I try displaying the image using imshow(), my memory usage goes 
>>>> up by around 500MB, each
>>>> time.  If I close the figure and replot it, imshow() crashes.  I don't 
>>>> know if I'm doing something
>>>> wrong, or if it's a new or known bug.  I tried the same thing on Linux and 
>>>> got the same result.
>>>> Here's a transcript.
>>>>
>>>>Welcome to pylab, a matplotlib-based Python environment.
>>>>For more information, type 'help(pylab)'.
>>>>
>>>> In [1]: import pyfits
>>>>
>>>> In [2]: from Tkinter import *
>>>>
>>>> In [3]: import tkFileDialog
>>>>
>>>> In [4]: image=pyfits.getdata(tkFileDialog.askopenfilename())
>>>>
>>>> In [5]: imshow(image)
>>>> Out[5]:
>>>>
>>>> In [6]: close()
>>>>
>>>> In [7]: imshow(image,origin='lower')
>>>> Out[7]:
>>>>
>>>> In [8]: close()
>>>>
>>>> In [9]: imshow(image[100:3600,100:3600],origin='lower')
>>>> Out[9]:
>>>>
>>>> In [10]: Exception in Tkinter callback
>>>> Traceback (most recent call last):
>>>>File "C:\app\Python2.6\lib\lib-tk\Tkinter.py", line 1410, in 
>>>> __call__
>>>>  return self.func(*args)
>>>>File "C:\app\Python2.6\lib\lib-tk\Tkinter.py", line 495, in callit
>>>>  func(*args)
>>>>File 
>>>> "C:\app\Python2.6\lib\site-packages\matplotlib\backends\backend_tkagg.py", 
>>>> line 263, in
>>>> idle_draw
>>>>  self.draw()
>>>>File 
>>>> "C:\app\Python2.6\lib\site-packages\matplotlib\backends\backend_tkagg.py", 
>>>> line 248, in draw
>>>>  FigureCanvasAgg.draw(self)
>>>>File 
>>>> "C:\app\Python2.6\lib\site-packages\matplotlib\backends\backend_agg.py", 
>>>> line 394, in draw
>>>>  self.figure.draw(self.renderer)
>>>>File "C:\app\Python2.6\lib\site-packages\matplotlib\artist.py", 
>>>> line 55, in draw_wrapper
>>>>  draw(artist, renderer, *args, **kwargs)
>>>>File "C:\app\Python2.6\lib\site-packages\matplotlib\figure.py", 
>>>> line 798, in draw
>>>>  func(*args)
>>>>File "C:\app\Python2.6\lib\site-packages\matplotlib\artist.py", 
>>>> line 55, in draw_wrapper
>>>>  draw(artist, renderer, *args, **kwargs)
>>>>File "C:\app\Python2.6\lib\site-packages\matplotlib\axes.py", line 
>>>> 1946, in draw
>>>>  a.draw(renderer)
>>>>File "C:\app\Python2.6\lib\site-packages\matplotlib\artist.py", 
>>>> line 55, in draw_wrapper
>>>>  draw(artist, renderer, *args, **kwargs)
>>>>File "C:\app\Python2.6\lib\site-packages\matplotlib\image.py", line 
>>>> 354, in draw
>>>>  im = self.make_image(renderer.get_image_magnification())
>>>>File "C:\app\Python2.6\lib\site-packages\matplotlib\image.py", line 
>>>> 569, in make_image
>>>>  transformed_viewLim)
>>>>File "C:\app\Python2.6\lib\site-packages\matplotlib\image.py", line 
>>>> 201, in _get_unsampled_image
>>>>  x = self.to_rgba(self._A, self._alpha)
>>>>File "C:\app\Python2.6\lib\site-packages\matplotlib\cm.py"

Re: [Matplotlib-users] Trouble with imshow

2011-02-03 Thread Robert Abiad
On 2/3/2011 10:06 AM, Eric Firing wrote:
> On 02/02/2011 10:17 PM, Eric Firing wrote:
>> On 02/02/2011 08:38 PM, Robert Abiad wrote:
>>>
>> [...]
>>> I'll put it in as an enhancement, but I'm still unsure if there is a
>>> bug in
>>> there as well. Is there something I should be doing to clear memory
>>> after the
>>> first figure is closed other than close()? I don't understand why
>>> memory usage
>>> grows each time I replot, but I'm pretty sure it isn't desireable
>>> behavior. As
>>> I mentioned, this effect is worse with plot.
>>>
>>> So is this a bug or improper usage?
>>
>> I'm not quite sure, but I don't think there is a specifically matplotlib
>> memory leak bug at work here. Are you using ipython, and if so, have you
>> turned off the caching? In its default mode, ipython keeps lots of
>> references, thereby keeping memory in use. Also, memory management and
>> reporting can be a bit tricky and misleading.
>>
>> Nevertheless, the attached script may be illustrating the problem. Try
>> running it from the command line as-is (maybe shorten the loop--it
>> doesn't take 100 iterations to show the pattern) and then commenting out
>> the line as indicated in the comment. It seems that if anything is done
>> that adds ever so slightly to memory use while the figure is displayed,
>> then when the figure is closed, its memory is not reused. I'm puzzled.
>
> I wasn't thinking straight--there is no mystery and no memory leak.
> Ignore my example script referred to above.  It was saving rows of the z
> array, not single elements as I had intended, so of course memory use
> was growing substantially.
>
> Eric
>

You may not see a memory leak, but I still can't get my memory back without 
killing python.  I 
turned off the ipython caching and even ran without iPython on both Windows and 
Ubuntu, but when I 
use imshow(), followed by close('all') and another imshow(), I run out of 
memory.  I can see from 
the OS that the memory does not come back after close() and that it grows after 
the second imshow().

Any other ideas?  Looks like a bug to me otherwise.

-robert

--
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] memory usage with repeated imshow

2011-02-09 Thread Robert Abiad
Tom,

I just went through this, though with version 1.01 of mpl, so it may be 
different.  You can read the 
very long thread at:

http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg20031.html

Those who maintain mpl don't think there is a memory leak. What I found was 
that imshow() does 
consume a lot of memory (now fixed in the development version) and that the 
first 2 or so uses build 
on each other, but after that it levels off giving back memory after close().  
There is a 
discrepancy between what python reports it's using and what the OS reports (I 
had 500MB from the OS, 
but only 150MB from python).  There is a chance that ipython is caching your 
results (try ipython 
-pylab -cs 0), but when I ran without ipython, python still had a large portion 
of memory.

-robert

On 2/9/2011 3:52 PM, Tom Dimiduk wrote:
> I am using matplotlib pylab in association with ipython -pylab to show
> many large (~2000x2000 or larger) images.  Each time I show another
> image it consumes more memory until eventually exhausting all system
> memory and making my whole system unresponsive.
>
> The easiest way to replicate this behaviour is with
> a = ones((,))
> imshow(a)
>
> optionally
>
> close()
>
> and then
>
> imshow(a)
>
> again.  I am using ipython .10.1 and matplotlib 0.99.3.  Is there
> something I should be doing differently to avoid this problem?  Is it
> fixed in a later version?
>
> Thanks,
> Tom
>
> --
> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] matplotlib on osx problem

2011-02-15 Thread Robert Thompson
Hi everyone,

I'm not quite sure what to call my problem so searching for it is 
difficult, but I'll try and describe it the best I can:

Matplotlib in python on OSX seems to have an issue with the pan/zoom 
tool.  When I click it and drag the plot around, it does not update 
until I release the mouse.  I've used this function on other *nix 
machines and it seems to be fine.  Here's a quick video describing what 
I mean if my description is unclear: 
http://www.youtube.com/watch?v=_cqUGpHGrl0

I have tried to switch the backend to osx in the matplotlibrc file, but 
the result is the same.  Any help you can provide would be greatly 
appreciated.  Thanks!

-Robert

--
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] hist doesn't like 2d arrays

2011-02-17 Thread Robert Abiad
Dear Folks,

I'm finding that hist has problems computing on 2d arrays.

import  numpy
import  pylab
mu,  sigma  =  2,  0.5
v  =  numpy.random.normal(mu,sigma,16)
pylab.hist(v,  bins=1000,  normed=1)

This works without any problems.  But if you try this:

w=v.reshape(400,400)
pylab.hist(w,  bins=1000,  normed=1)

it doesn't come back on my machine until all of memory is used up.  However:

n,bins = numpy.histogram(w,bins=1000,normed=1)

works just fine.




--
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [SciPy-User] use matplotlib to produce mathathematical expression only

2011-05-16 Thread Robert Kern
On Mon, May 16, 2011 at 08:21, Johannes Radinger  wrote:
> Hello,
>
> I want to produce a eps file of following mathematical expression:
> r'$F(x)=p*\frac{1}{s1\sqrt{2\pi}}*e^{-\frac{1}{2}*(\frac{x-m}{s1})}+(1-p)*\frac{1}{s1\sqrt{2\pi}}*e^{-\frac{1}{2}*(\frac{x-m}{s1})}$'
>
> is it possible to somehow missuse matplotlib for that to produce only the 
> function without any other plot things? Or is there a better python library 
> within scipy? I don't want to install the complete latex libraries just for 
> producing this single eps file.

Check out mathtex. It is matplotlib's TeX parsing engine and renderer
broken out into a separate library:

http://code.google.com/p/mathtex/

Also, please send matplotlib questions just to the matplotlib list. Thanks.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco

--
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] use matplotlib to produce mathathematical expression only

2011-05-16 Thread Robert Kern
On Mon, May 16, 2011 at 09:23, Johannes Radinger  wrote:
>
>  Original-Nachricht 
>> Datum: Mon, 16 May 2011 08:28:49 -0500
>> Von: Robert Kern 
>> An: SciPy Users List 
>> CC: matplotlib-users@lists.sourceforge.net
>> Betreff: Re: [Matplotlib-users] [SciPy-User] use matplotlib to produce       
>>  mathathematical expression only
>
>> On Mon, May 16, 2011 at 08:21, Johannes Radinger  wrote:
>> > Hello,
>> >
>> > I want to produce a eps file of following mathematical expression:
>> >
>> r'$F(x)=p*\frac{1}{s1\sqrt{2\pi}}*e^{-\frac{1}{2}*(\frac{x-m}{s1})}+(1-p)*\frac{1}{s1\sqrt{2\pi}}*e^{-\frac{1}{2}*(\frac{x-m}{s1})}$'
>> >
>> > is it possible to somehow missuse matplotlib for that to produce only
>> the function without any other plot things? Or is there a better python
>> library within scipy? I don't want to install the complete latex libraries 
>> just
>> for producing this single eps file.
>>
>> Check out mathtex. It is matplotlib's TeX parsing engine and renderer
>> broken out into a separate library:
>>
>> http://code.google.com/p/mathtex/
>
> I also thought about mathtex but don't know how to use my mathematical 
> expression without a plot of axis etc. any suggestions? I just want to have 
> the formated math expression as eps and I don't know how to do it, still 
> after reading in the matplotlib-manual.

The mathtex that I link to above is a separate library, not a part of
matplotlib. Please follow the link.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco

--
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plotting using an image as background

2011-07-15 Thread robert rottermann

On 15.07.2011 17:56, Benjamin Root wrote:



On Fri, Jul 15, 2011 at 10:49 AM, robert <mailto:rob...@redcor.ch>> wrote:


Hi there,
I am all new to mathlib world..

What I try to do is plotting some charts over an image.
I would be very grateful, if somebody could provide me with an example.
thanks
    robert


Welcome Robert,

This is fairly straight-forward.  If you have a image file, you can plot it 
like so:


>>> import matplotlib.pyplot as plt
>>> imData = plt.imread("foobar.png")
>>> plt.imshow(imData)

Now, the tricky issue is that the coordinate system for the plot may be a bit 
backwards than you might want for normal plotting.  The (0, 0) coordinate will 
be in the upper-left instead of the lower-left.  Plus, the axis limits will be 
in pixels.  This may or may not be an issue depending on what you plan to plot 
on top of the image.  And, of course, unless you are in interactive mode, you 
will need to do a "plt.show()" call when you are finished building the plot 
and want to display it to the screen.


I hope this helps and let us know if you have any other questions!
Ben Root


thank a lot Ben,
it feels really good when you get answers that fast ..
one more question: can I as imData what dimensions it has?

thanks
robert
--
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] hot to draw a line connecting a list of points

2011-07-20 Thread robert rottermann
hi there,

I would like to draw a a set of lines on top of an image.
Somehow I do not get the result I want

these are the points ((267, 140), (380, 773), (267, 958))

one of my divers atempts is:

pic = plt.imread('../hlwd/effizienz_balken_01.jpg')
pic = np.fliplr(np.rot90(pic, k=2))
plt.imshow(pic)

frame1 = plt.gca()

lx = []
ly = []
for pt in ((267, 140), (380, 773), (267, 958)):
 lx.append(pt[0])
 ly.append(pt[1])
x,y = np.array([lx, ly])
line = mlines.Line2D(x, y, lw=5., alpha=0.4)

frame1.add_line(line)

plt.show()

which produces on line instad of two.

thanks for any pointers
robert


--
10 Tips for Better Web Security
Learn 10 ways to better secure your business today. Topics covered include:
Web security, SSL, hacker attacks & Denial of Service (DoS), private keys,
security Microsoft Exchange, secure Instant Messaging, and much more.
http://www.accelacomm.com/jaw/sfnl/114/51426210/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] hot to draw a line connecting a list of points

2011-07-21 Thread robert rottermann
who ever migth be interested:
I achieved my goal in drawing lines trough a set of points using the path modul.

http://matplotlib.sourceforge.net/users/path_tutorial.html

robert
On 20.07.2011 20:49, robert rottermann wrote:
> hi there,
>
> I would like to draw a a set of lines on top of an image.
> Somehow I do not get the result I want
>
> these are the points ((267, 140), (380, 773), (267, 958))
>
> one of my divers atempts is:
>
> pic = plt.imread('../hlwd/effizienz_balken_01.jpg')
> pic = np.fliplr(np.rot90(pic, k=2))
> plt.imshow(pic)
>
> frame1 = plt.gca()
>
> lx = []
> ly = []
> for pt in ((267, 140), (380, 773), (267, 958)):
>   lx.append(pt[0])
>   ly.append(pt[1])
> x,y = np.array([lx, ly])
> line = mlines.Line2D(x, y, lw=5., alpha=0.4)
>
> frame1.add_line(line)
>
> plt.show()
>
> which produces on line instad of two.
>
> thanks for any pointers
> robert
>
>
> --
> 10 Tips for Better Web Security
> Learn 10 ways to better secure your business today. Topics covered include:
> Web security, SSL, hacker attacks&  Denial of Service (DoS), private keys,
> security Microsoft Exchange, secure Instant Messaging, and much more.
> http://www.accelacomm.com/jaw/sfnl/114/51426210/
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
5 Ways to Improve & Secure Unified Communications
Unified Communications promises greater efficiencies for business. UC can 
improve internal communications as well as offer faster, more efficient ways
to interact with customers and streamline customer service. Learn more!
http://www.accelacomm.com/jaw/sfnl/114/51426253/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] controllin the background of a plot

2011-07-23 Thread robert rottermann
Hi there,

I am creating an image with mathplotlib. This image is then shown an a web page.
now ma question.
the Image is set in a large gray area. I assume it is the space needed for the 
axis which I do not show.
How can I suppress this gray background?

thanks
robert

here the code I use to create the image:
 def makeHlwdChart(self, values = ['a', 'd', 'e', 'f', 'b']):
 # the need for following two lines I learned by appling voodoo and pdb
 img_resource = 
self.context.restrictedTraverse('++resource++effizienz_balken_01.jpg')
 imp_path = img_resource.context.path
 pic = plt.imread(imp_path)
 # the picture is upside down so rotate and fip it
 pic = np.fliplr(np.rot90(pic, k=2))
 # draw it on the canvas
 plt.imshow(pic)
 frame1 = plt.gca()
 # hide axes
 frame1.axes.get_xaxis().set_visible(False)
 frame1.axes.get_yaxis().set_visible(False)
 #frame1.subplots_adjust(left=0)

 # generate the colored markers that denot the value
 # write a label so, that it is within the marker
 funs = [th, ge, hh, en, pr]
 font0 = FontProperties()
 font = font0.copy()
 font.set_weight('bold')
 for i in range(len(values)):
 # add the colord marker
 frame1.add_patch(funs[i](values[i], True))
 # get postition of the label
 p = funs[i](values[i], offset=TEXTOFFSET)
 # write the label
 frame1.text(p[0], p[1], values[i].upper(), fontproperties=font)

 return pic


--
Storage Efficiency Calculator
This modeling tool is based on patent-pending intellectual property that
has been used successfully in hundreds of IBM storage optimization engage-
ments, worldwide.  Store less, Store more with what you own, Move data to 
the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] controllin the background of a plot

2011-07-23 Thread robert rottermann
thanks ben,
(sorry for sending answer twice)

> When you call savefig(), you can pass it the kwarg option of
> bbox_inches='tight' and that should help get rid of any extra area you
> may have.
>
> Ben Root
I tried to follow your advice. however it did not help. This is what I do:

- get the current figure with gcf.
- read an image from a file with imread
- save it to the canvas with imsave
- hide the axes
- call fig.savefig('out.svg', transparent=True, bbox_inches='tight', 
pad_inches=0)

then I create a PIL Image and return it to the calling web server.

The image is displayed with a fat (1.5 cm) gray border which I do not want.

thanks for any further intelligence

robert

here is my code cleansed of irrelevant parts

# supporting method creating the plot
def makeHlwdChart(self, values = ['a', 'd', 'e', 'f', 'b']):
 # get current axes object
 frame1 = plt.gca()
 # get current figure
 fig = plt.gcf()
 # read the image file
 pic = plt.imread(imp_path)
 # the picture is upside down so rotate and fip it
 pic = np.fliplr(np.rot90(pic, k=2))
 # draw it on the canvas
 plt.imshow(pic, figure=fig)
 # hide axes
 frame1.axes.get_xaxis().set_visible(False)
 frame1.axes.get_yaxis().set_visible(False)

 fig.savefig('out.svg', transparent=True, bbox_inches='tight', 
pad_inches=0)

 return pic

# method called from the web server
def __call__(self, w=300, h=300, default_format = 'PNG', set_headers=False):
 # lock graphics
 imageThreadLock.acquire()
 # we don't want different threads to write on each other's canvases,
 # make sure we have a new one
 pylab.close()
 # makeHlwdChart draws on the canvas, so we do not need its return value
 makeHlwdChart(self, values)
 canvas = pylab.get_current_fig_manager().canvas
 canvas.draw()
 imageSize = canvas.get_width_height()
 imageRgb = canvas.tostring_rgb()
 img = Image.fromstring("RGB", imageSize, imageRgb)
 #size = int(w), int(h)
 #img.thumbnail(size, Image.ANTIALIAS)
 format = img.format and img.format or default_format
 thumbnail_file = StringIO()
 ## quality parameter doesn't affect lossless formats
 img.save(thumbnail_file, format, quality=88)
 thumbnail_file.seek(0)
 if set_headers:
 self.request.RESPONSE.setHeader('Pragma', 'no-cache')
 self.request.RESPONSE.setHeader('Content-Type', 'image/%s' % 
format)

 # unlock graphics
 imageThreadLock.release()

 return thumbnail_file.getvalue()


--
Storage Efficiency Calculator
This modeling tool is based on patent-pending intellectual property that
has been used successfully in hundreds of IBM storage optimization engage-
ments, worldwide.  Store less, Store more with what you own, Move data to 
the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] controllin the background of a plot

2011-07-23 Thread robert rottermann

On 23/07/11 23:17, Benjamin Root wrote:
On Sat, Jul 23, 2011 at 2:53 PM, robert rottermann 
mailto:robert.rotterm...@gmx.ch>> wrote:


thanks ben,
(sorry for sending answer twice)

> When you call savefig(), you can pass it the kwarg option of
> bbox_inches='tight' and that should help get rid of any extra
area you
> may have.
>
> Ben Root
I tried to follow your advice. however it did not help. This is
what I do:

- get the current figure with gcf.
- read an image from a file with imread
- save it to the canvas with imsave
- hide the axes
- call fig.savefig('out.svg', transparent=True, bbox_inches='tight',
pad_inches=0)

then I create a PIL Image and return it to the calling web server.

The image is displayed with a fat (1.5 cm) gray border which I do
not want.

thanks for any further intelligence

robert

here is my code cleansed of irrelevant parts

# supporting method creating the plot
def makeHlwdChart(self, values = ['a', 'd', 'e', 'f', 'b']):
# get current axes object
frame1 = plt.gca()
# get current figure
fig = plt.gcf()
# read the image file
pic = plt.imread(imp_path)
# the picture is upside down so rotate and fip it
pic = np.fliplr(np.rot90(pic, k=2))
# draw it on the canvas
plt.imshow(pic, figure=fig)
# hide axes
frame1.axes.get_xaxis().set_visible(False)
frame1.axes.get_yaxis().set_visible(False)

fig.savefig('out.svg', transparent=True, bbox_inches='tight',
pad_inches=0)

return pic

# method called from the web server
def __call__(self, w=300, h=300, default_format = 'PNG',
set_headers=False):
# lock graphics
imageThreadLock.acquire()
# we don't want different threads to write on each other's
canvases,
# make sure we have a new one
pylab.close()
# makeHlwdChart draws on the canvas, so we do not need its
return value
makeHlwdChart(self, values)
canvas = pylab.get_current_fig_manager().canvas
canvas.draw()
imageSize = canvas.get_width_height()
imageRgb = canvas.tostring_rgb()
img = Image.fromstring("RGB", imageSize, imageRgb)
#size = int(w), int(h)
#img.thumbnail(size, Image.ANTIALIAS)
format = img.format and img.format or default_format
thumbnail_file = StringIO()
## quality parameter doesn't affect lossless formats
img.save(thumbnail_file, format, quality=88)
thumbnail_file.seek(0)
if set_headers:
self.request.RESPONSE.setHeader('Pragma', 'no-cache')
self.request.RESPONSE.setHeader('Content-Type', 'image/%s' %
format)

# unlock graphics
imageThreadLock.release()

return thumbnail_file.getvalue()


Does the image look correct if you save it as a PNG file?  It might be 
a problem with the SVG backend.   Also, which version of matplotlib 
are you using.  There was a lot of work on the bbox_inches stuff and 
this problem might have already been fixed.


Ben Root


using png did not help,

matplotlib.__version__  :  0.99.3
numpy: 1.5.1

as provided by the newest ubuntu


thanks
robert


--
Storage Efficiency Calculator
This modeling tool is based on patent-pending intellectual property that
has been used successfully in hundreds of IBM storage optimization engage-
ments, worldwide.  Store less, Store more with what you own, Move data to 
the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] controllin the background of a plot

2011-07-24 Thread robert rottermann
Ok, your version is quite old, and might be older than when the 
bbox_inches='tight' feature was added.  Unfortunately, the way savefig 
was designed, I think it would swallow extra kwargs.
>
> The current matplotlib is version 1.0.1, and we are getting close to 
> cutting a new v1.1.0 release.  Debian (which Ubuntu is based on), had 
> a policy conflict with how we packaged our documents and did not 
> update matplotlib in their repositories (although it should be updated 
> in time for their next release).  I would recommend building from source:
>
> http://matplotlib.sourceforge.net/users/installing.html#installing-from-source
>
> Note that you can obtain all of the required packages for building by 
> running:
>
> sudo apt-get build-dep python-matplotlib
>
> and then build matplotlib yourself from source.
>
> I hope this helps!
> Ben Root
>
>
I was barking up the wrong tree..

the picture is saved with imsave correctly (without extra space around it).
However I generated it a second time using canvas.tostring_rgb() which I 
then send to the web server.

When I pass a StringIO instance to imsave everything works as expected.

thanks again for your help
robert

--
Magic Quadrant for Content-Aware Data Loss Prevention
Research study explores the data loss prevention market. Includes in-depth
analysis on the changes within the DLP market, and the criteria used to
evaluate the strengths and weaknesses of these DLP solutions.
http://www.accelacomm.com/jaw/sfnl/114/51385063/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] controllin the background of a plot

2011-07-25 Thread robert rottermann
thanks ben,
(sorry for sending answer twice)

> When you call savefig(), you can pass it the kwarg option of
> bbox_inches='tight' and that should help get rid of any extra area you
> may have.
>
> Ben Root
I tried to follow your advice. however it did not help. This is what I do:

- get the current figure with gcf.
- read an image from a file with imread
- save it to the canvas with imsave
- hide the axes
- call fig.savefig('out.svg', transparent=True, bbox_inches='tight', 
pad_inches=0)

then I create a PIL Image and return it to the calling web server.

The image is displayed with a fat (1.5 cm) gray border which I do not want.

thanks for any further intelligence

robert

here is my code cleansed of irrelevant parts

# supporting method creating the plot
def makeHlwdChart(self, values = ['a', 'd', 'e', 'f', 'b']):
 # get current axes object
 frame1 = plt.gca()
 # get current figure
 fig = plt.gcf()
 # read the image file
 pic = plt.imread(imp_path)
 # the picture is upside down so rotate and fip it
 pic = np.fliplr(np.rot90(pic, k=2))
 # draw it on the canvas
 plt.imshow(pic, figure=fig)
 # hide axes
 frame1.axes.get_xaxis().set_visible(False)
 frame1.axes.get_yaxis().set_visible(False)

 fig.savefig('out.svg', transparent=True, bbox_inches='tight', 
pad_inches=0)

 return pic

# method called from the web server
def __call__(self, w=300, h=300, default_format = 'PNG', set_headers=False):
 # lock graphics
 imageThreadLock.acquire()
 # we don't want different threads to write on each other's canvases,
 # make sure we have a new one
 pylab.close()
 # makeHlwdChart draws on the canvas, so we do not need its return value
 makeHlwdChart(self, values)
 canvas = pylab.get_current_fig_manager().canvas
 canvas.draw()
 imageSize = canvas.get_width_height()
 imageRgb = canvas.tostring_rgb()
 img = Image.fromstring("RGB", imageSize, imageRgb)
 #size = int(w), int(h)
 #img.thumbnail(size, Image.ANTIALIAS)
 format = img.format and img.format or default_format
 thumbnail_file = StringIO()
 ## quality parameter doesn't affect lossless formats
 img.save(thumbnail_file, format, quality=88)
 thumbnail_file.seek(0)
 if set_headers:
 self.request.RESPONSE.setHeader('Pragma', 'no-cache')
 self.request.RESPONSE.setHeader('Content-Type', 'image/%s' % 
format)

 # unlock graphics
 imageThreadLock.release()

 return thumbnail_file.getvalue()


--
Storage Efficiency Calculator
This modeling tool is based on patent-pending intellectual property that
has been used successfully in hundreds of IBM storage optimization engage-
ments, worldwide.  Store less, Store more with what you own, Move data to 
the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] py2app setup.py example?

2011-09-01 Thread Robert Sudwarts
Hi Carlos,

It's a bit tricky giving you a complete example as the specifics will vary
considerably depending on which versions of python, matplotlib & wx you're
using:

I'd point you toward the wxPyWiki page at:
http://wiki.wxpython.org/py2exe-python26  which gives a pretty sound example
based on an output produced by GUI2Exe (written by Andrea Gavana)

As for matplotlib specifically, see:
http://www.py2exe.org/index.cgi/MatPlotLib (again depending very much on the
versions you're using), I've found that the first example given works
perfectly.

Hope that helps!





On 1 September 2011 04:42, Carlos Grohmann wrote:

> Hello all.
>
> I've been looking for a good example of setup.py to build a bundle app with
> wxpython+matplotlib.
> Can someone share or point me in a direction?
>
> thanks
>
> --
> Prof. Carlos Henrique Grohmann - Geologist D.Sc.
> Institute of Geosciences - Univ. of São Paulo, Brazil
> http://www.igc.usp.br/pessoais/guano
> http://lattes.cnpq.br/5846052449613692
> Linux User #89721
> 
> Can’t stop the signal.
>
>
> --
> Special Offer -- Download ArcSight Logger for FREE!
> Finally, a world-class log management solution at an even better
> price-free! And you'll get a free "Love Thy Logs" t-shirt when you
> download Logger. Secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsisghtdev2dev
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] py2app setup.py example?

2011-09-01 Thread Robert Sudwarts
Apologies -- I should have read the subject line!  :)

On 1 September 2011 14:00, Carlos Grohmann wrote:

> Hello Robert,
>
> Thank you for your kind response, but I'm looking into py2app, for Mac OSX,
> and it is a bit different than py2exe. I do have a py2exe script working
> (lots of examples around), but I'm still a bit lost on the Mac-related
> stuff.
>
> cheers
>
> Carlos
>
>
> On Thu, Sep 1, 2011 at 05:34, Robert Sudwarts 
> wrote:
>
>> Hi Carlos,
>>
>> It's a bit tricky giving you a complete example as the specifics will vary
>> considerably depending on which versions of python, matplotlib & wx you're
>> using:
>>
>> I'd point you toward the wxPyWiki page at:
>> http://wiki.wxpython.org/py2exe-python26  which gives a pretty sound
>> example based on an output produced by GUI2Exe (written by Andrea Gavana)
>>
>> As for matplotlib specifically, see:
>> http://www.py2exe.org/index.cgi/MatPlotLib (again depending very much on
>> the versions you're using), I've found that the first example given works
>> perfectly.
>>
>> Hope that helps!
>>
>>
>>
>>
>>
>> On 1 September 2011 04:42, Carlos Grohmann wrote:
>>
>>> Hello all.
>>>
>>> I've been looking for a good example of setup.py to build a bundle app
>>> with wxpython+matplotlib.
>>> Can someone share or point me in a direction?
>>>
>>> thanks
>>>
>>> --
>>> Prof. Carlos Henrique Grohmann - Geologist D.Sc.
>>> Institute of Geosciences - Univ. of São Paulo, Brazil
>>> http://www.igc.usp.br/pessoais/guano
>>> http://lattes.cnpq.br/5846052449613692
>>> Linux User #89721
>>> 
>>> Can’t stop the signal.
>>>
>>>
>>> --
>>> Special Offer -- Download ArcSight Logger for FREE!
>>> Finally, a world-class log management solution at an even better
>>> price-free! And you'll get a free "Love Thy Logs" t-shirt when you
>>> download Logger. Secure your free ArcSight Logger TODAY!
>>> http://p.sf.net/sfu/arcsisghtdev2dev
>>> ___
>>> Matplotlib-users mailing list
>>> Matplotlib-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>
>
>
> --
> Prof. Carlos Henrique Grohmann - Geologist D.Sc.
> Institute of Geosciences - Univ. of São Paulo, Brazil
> http://www.igc.usp.br/pessoais/guano
> http://lattes.cnpq.br/5846052449613692
> Linux User #89721
> 
> Can’t stop the signal.
>
--
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] installing numpy, matplotlib, scipy from source on a Mac

2007-01-10 Thread Robert Kern
belinda thom wrote:
> I am posting this message to both numpy and matplotlib mailing lists  
> because the thread relates to both.

Actually, it's really only relevant to matplotlib.

> However, after installing wx and matplotlib, various problems result:
> 
> 1) warnings about fonts
> 2) wx fails to work
> 
> I've appended the warnings below. These only occur the first time  
> pylab is imported (does this make sense?).

Yes. After the first time, a cache is built and the font manager doesn't go
trawling through your fonts again. matplotlib's font library cannot parse some
of the Mac fonts (damned resource forks), so it warns you.

Personally, I think the warnings are a bit overzealous and should be silenced.
It's not as if the user is explicitly telling the font manager to load those
specific fonts. They are automatically and unavoidably attempted.

> WX / MATPLOTLIB FAILURE
> ------
> 
> 4 % python

Try running with pythonw.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco


-
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] installing numpy, matplotlib, scipy from source on a Mac

2007-01-10 Thread Robert Kern
John Hunter wrote:
>>>>>> "Robert" == Robert Kern <[EMAIL PROTECTED]> writes:
> 
> Robert> Personally, I think the warnings are a bit overzealous and
> Robert> should be silenced.  It's not as if the user is explicitly
> Robert> telling the font manager to load those specific
> Robert> fonts. They are automatically and unavoidably attempted.
> 
> I just modified the font manager to move this reporting into the
> verbose handler, so now they will only show up with verbose "helpful"
> or greater.

And there was much rejoicing!

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco


-
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] installing numpy, matplotlib, scipy from source on a Mac

2007-01-10 Thread Robert Kern
belinda thom wrote:
> Robert,
> 
>> Try running with pythonw.
> 
> Do you know how to fix this in IDLE (it must be using python as  
> opposed to pythonw somehow).

I'm afraid that I don't know enough about IDLE to help you.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco


-
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] installing numpy, matplotlib, scipy from source on a Mac

2007-01-10 Thread Robert Kern
belinda thom wrote:
> I went back and retried the plotting w/wx  
> as a backend and discovered that wx FAILS with PYTHONW and PYTHON  
> (appended).

Okay, what version of wxPython did you install? What version of wxPython is
actually imported (check wx.__version__)?

(And we can leave off numpy-discussion, it's not relevant there).

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco


-
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] installing numpy, matplotlib, scipy from source on a Mac

2007-01-10 Thread Robert Kern
belinda thom wrote:
> Hi,
> 
> On Jan 10, 2007, at 5:56 PM, Robert Kern wrote:
> 
>> belinda thom wrote:
>>> I went back and retried the plotting w/wx
>>> as a backend and discovered that wx FAILS with PYTHONW and PYTHON
>>> (appended).
>> Okay, what version of wxPython did you install? What version of  
>> wxPython is
>> actually imported (check wx.__version__)?
> 
> Python 2.4.4 (#1, Oct 18 2006, 10:34:39)
> [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> history mechanism set up
>  >>> import wx
>  >>> wx.__version__
> '2.6.3.3'

Okay, let me rephrase: which binary package of wxPython did you install?

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco


-
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] installing numpy, matplotlib, scipy from source on a Mac

2007-01-11 Thread Robert Kern
Christopher Barker wrote:

> The MPL build system uses a nifty utility that comes with wx called 
> wx-config to find the wx libs. However, Apple delivered an old version 
> of wxPython with it's Python2.3. By default, the MPL build find the old 
> wx-config, and you end up building the wxAgg back-end against that 
> version of wx, which is not the one you want. Try this:

Yes, thank you for figuring that out! That's the part that I forgot about.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco


-
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] Newbie trying to get matplotlib up and running on Mac mini.....

2007-02-05 Thread Robert Kern
Jonathan Kane wrote:
> Hi,
>I have a Mac mini with Intel Duo processors.  I downloaded and
> installed python, numpy, and scipy on my machine.  I downloaded already
> built binaries from the website http://www.scipy.org/Download
> 
> The file I downloaded was ScipySuperpack-Intel-10.4-py2.4
> matplotlib was a part of that package.
> 
> This is what I get when I launch python, numpy, scipy, and matplotlib.
> 
> adsl-69-154-179-12:~ seismic73$ python
> ActivePython 2.4.3 Build 11 (ActiveState Software Inc.) based on
> Python 2.4.3 (#1, Apr  3 2006, 18:07:14)
> [GCC 4.0.1 (Apple Computer, Inc. build 5247)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>>
>>>> from numpy import *
>>>> from scipy import *
>>>> from pylab import *
> Traceback (most recent call last):
>   File "", line 1, in ?
>   File
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/pylab.py",
> line 1, in ?
> from matplotlib.pylab import *
> ImportError: No module named matplotlib.pylab

Hrmm. Unfortunately, the matplotlib package in (at least) the Intel version is
still missing matplotlib/__init__.py. You can download the file from here:

http://matplotlib.svn.sourceforge.net/viewvc/*checkout*/matplotlib/trunk/matplotlib/lib/matplotlib/__init__.py?revision=2835

Put it in
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


  1   2   >