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


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] 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] 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] [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] 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


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] 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] 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


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


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] 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] 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 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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
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 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] 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] 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] 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-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] 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] 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] 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] 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] 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] 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] 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] 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] 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


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] 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] 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:

> 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-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] 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] Kriging with Matplotlib

2008-05-16 Thread Robert Kern
Leif Oppermann wrote:
> Can someone tell me how to do kriging in Matplotlib?
> 
> I have tried the contourf() function with two bivariate_normal() objects 
> as input which produces similar looking results to what I want to 
> archive. My data however is geo-referenced and contains > 10 
> samples. Generating 10 objects doesn't sound like a good idea to me. 
> I searched the docs before posting, but the term "kriging" doesn't even 
> show in the docs.
> 
> Maybe I missed something obvious? Any hint appreciated.

There is no kriging implementation in matplotlib. Kriging is a special case of 
Gaussian processes, though, so the RandomRealizations package or my own gp 
package might be of use to you. You will have to do some reading to translate 
the entities you are familiar with (variograms, etc.) to the entities used in 
Gaussian processes (covariance functions, etc.).

   http://code.google.com/p/random-realizations/
   http://www.enthought.com/~rkern/cgi-bin/hgwebdir.cgi/gp/

Anand has been doing more work on RandomRealizations than I have on gp, so try 
it 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: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Prism colormap

2008-04-07 Thread Robert Kern
Rich Fought wrote:
> The prism colormap repeats the same pattern over and over instead of 
> spreading itself over the plotted data range in a pcolor plot.  Is this 
> expected behavior?

Yup. prism and flag are designed to repeat.

-- 
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 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


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

2008-04-01 Thread Robert Kern
John wrote:
> Hello, could someone please help me understand a strange problem, 
> possibly associated with PYTHONPATH. When I import matplotlib, pylab, or 
> scipy from any directory other than the root installation directory, it 
> fails. However, if I'm in the python installation directory there are no 
> errors. Thanks in advance! Please see below:
> 
> [EMAIL PROTECTED] ~]$ python*
> Python 2.5.1 (r251:54863, Mar  7 2008, 04:10:12)
> [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> import scipy
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/usr/lib/python2.5/site-packages/scipy/__init__.py", line 18, in 
> 
> import pkg_resources as _pr # activate namespace packages 
> (manipulates __path__)
>   File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 2581, 
> in 
> add_activation_listener(lambda dist: dist.activate())
>   File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 640, in 
> subscribe
> callback(dist)
>   File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 2581, 
> in 
> add_activation_listener(lambda dist: dist.activate())
>   File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 2130, 
> in activate
> map(declare_namespace, self._get_metadata('namespace_packages.txt'))
>   File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 1749, 
> in declare_namespace
> _handle_ns(packageName, path_item)
>   File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 1712, 
> in _handle_ns
> module = sys.modules[packageName] = new.module(packageName)
> AttributeError: 'module' object has no attribute 'module'

You have a new.py module somewhere which is interfering with the standard 
library's "new" module. Find it and rename it.

-- 
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


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


Re: [Matplotlib-users] Bogus colour gradients in imshow()

2008-03-17 Thread Robert Kern
Christian Lerrahn wrote:
> Hi,
> I'm plotting some 2D grid data using imshow(). However, one of my test
> problems involves a Gaussian peak in the center of my grid. For some
> strange reason this Gaussian looks like 5 distinct peaks. It looks like
> the values are only set at the centers of my grid cells and then the
> colour gradients are interpolate from this central point and a
> background.
> You can have a look at the original plot and a magnified one at
> 
> http://www.maths.monash.edu.au/~clerrahn/gaussian1.png
> http://www.maths.monash.edu.au/~clerrahn/gaussian2.png

The problem is that the colors are being set at the points by looking them up 
in 
the colormap, and the intermediate colors are being interpolated between those 
looked-up colors (this may be the point you are trying to make, but I couldn't 
be sure). The peak color is correct; it only looks like it is lower than the 
four surrounding points because that colormap is not a very good one for this 
kind of data. Use a single-hue colormap, instead.

The alternative is to interpolate the *values* at the intermediate pixels 
first, 
and then look up the colors for each pixel in the colormap. This would give 
more 
reasonable results even with misapplied colormaps. However, it will probably be 
less efficient to implement.

-- 
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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Basemap - ImportError: libgeos_c.so.1

2007-12-15 Thread Robert Kern
Jeff Whitaker wrote:

> Dave:  Perhaps you need to add /usr/local to LD_LIBRARY_PATH?

It would be /usr/local/lib, not /usr/local

-- 
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


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


Re: [Matplotlib-users] Automatic Marker Generation

2007-10-04 Thread Robert Kern
David D Clark wrote:
> Hi Folks,
> 
> I have an array A=f(x) with a family of curves.  Is there an easy way to
> get a different marker for each line of plot(x,A).

Use itertools.cycle() to make an iterator that goes round-and-round. Use
itertools.izip() to match it up with your data, and perhaps a set of colors, 
too.


import itertools


def marker_cycle():
""" Return an infinite, cycling iterator over the available marker symbols.

This is wrapped in a function to make sure that you get a new iterator
that starts at the beginning every time you request one.
"""
return itertools.cycle([
'o','^','v','<','>',
's','+','x','D','d',
'1','2','3','4','h',
'H','p','|','_'])

for kk, m in itertools.izip(range(A.shape[0]), marker_cycle()):
loglog(f, A[kk], linestyle='-', marker=m, lw=2)


-- 
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: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plot cdf

2007-09-26 Thread Robert Kern
Alan Isaac wrote:
> Is there a standard function or practice for
> plotting the CDF of a series?  (I am aware
> of the output of hist.)

import numpy as np
from matplotlib import pylab

x = ... # whatever
n = len(x)
x2 = np.repeat(x, 2)
y2 = np.hstack([0.0, np.repeat(np.arange(1,n) / float(n), 2), 1.0])
pylab.plot(x2, y2)

-- 
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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] All-in-one distribution of python/numpy/scipy/mpl for windows

2007-05-14 Thread Robert Kern
Christopher Barker wrote:
> Robert Kern wrote:
>> Mark Bakker wrote:
>>> I think it would be very useful to have one installer that gets a
>>> reasonable distrubtion installed (like the old Enthought installer).
>>> Isn't something like that in the works for the Mac?
>> Not anymore it isn't. We are in the process of building eggs for the Mac, 
>> though.
> 
> What's the plan with:
> 
>   - PPC vs. Intel -- has someone figured out how to make Universal 
> binaries from Fortran?

I think we're just going to build on Intel. Most things will be Universal, but
scipy won't.

>   - wxPython versioning -- though if you go with 2.8+ you should be able 
> to keep that easy. If you need some wxPython/MPL testing -- let me know, 
> and I'll try to help.

We're looking at moving our stuff to wx 2.8 in the near term, so probably that.

-- 
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 DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] All-in-one distribution of python/numpy/scipy/mpl for windows

2007-05-14 Thread Robert Kern
Mark Bakker wrote:
> I think it would be very useful to have one installer that gets a
> reasonable distrubtion installed (like the old Enthought installer).
> Isn't something like that in the works for the Mac?

Not anymore it isn't. We are in the process of building eggs for the Mac, 
though.

-- 
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 DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] use of enthought Python for matplotlib/numpy

2007-05-11 Thread Robert Kern
Giorgio Luciano wrote:
> I would add one box of donuts, since I'm trying to make my own 
> distribution with numpy/scipy/matplotlib but with no success.
> and the problem is the same is for a classroom ;) If anyone knows also a 
> portable distribution with this package I will add extra donuts ;)

While we at Enthought are not updating the all-in-one installer anymore, we are
distributing up-to-date binaries as eggs.

  http://code.enthought.com/enstaller/

-- 
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 DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] freetypelib problem scipy superpack matplotlib

2007-05-04 Thread Robert Kern
Robert Kern wrote:
> Christopher Barker wrote:
>> Samuel M. Smith wrote:
>>> I did not have this problem with the matplotlib on
>>> http://pythonmac.org/packages/py25-fat/dmg/matplotlib-0.90.0-py2.5-macosx10.4-2007-02-20.dmg
>> That one was probably built with a statically linked freetype, as the 
>> one Apple provides doesn't work with MPL.
> 
> No, it was built against a dynamic freetype library which was not included 
> with
> the package. If it had been statically linked, there wouldn't be a problem.

My deepest apologies. I misread your post as referring to the Scipy Superpack
package. You are correct.

-- 
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 DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] freetypelib problem scipy superpack matplotlib

2007-05-04 Thread Robert Kern
Samuel M. Smith wrote:
> So the conclusion is pythonmac matplotlib uses a statically linked  
> freetype so it doesn't look into /usr/local/lib
> and Fonnesbeck's scipy superpack matplotlib is using a dynamically  
> linked freetype which is looking into /usr/local/lib

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


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] freetypelib problem scipy superpack matplotlib

2007-05-04 Thread Robert Kern
Christopher Barker wrote:
> Samuel M. Smith wrote:
>> I did not have this problem with the matplotlib on
>> http://pythonmac.org/packages/py25-fat/dmg/matplotlib-0.90.0-py2.5-macosx10.4-2007-02-20.dmg
> 
> That one was probably built with a statically linked freetype, as the 
> one Apple provides doesn't work with MPL.

No, it was built against a dynamic freetype library which was not included with
the package. If it had been statically linked, there wouldn't be a problem.

-- 
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 DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problems building/installing

2007-04-04 Thread Robert Kern
Tim Hirzel wrote:
> Its a little tough right now that os x doesn't have one python 
> install to rule them all.

Yes it does.

  http://www.python.org/download/

-- 
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] matplotlib and py2exe

2007-03-31 Thread Robert Kern
Archana Ganesan wrote:
> Hi all,
> 
> The exception I get is
> Traceback (most recent call last):
>   File "App1.py", line 6, in ?
>   File "Frame1.pyc", line 9, in ?
>   File "Simulation.pyc", line 16, in ?
>   File "pylab.pyc", line 1, in ?
>   File "matplotlib\pylab.pyc", line 199, in ?
>   File "matplotlib\cm.pyc", line 5, in ?
>   File "matplotlib\colors.pyc", line 33, in ?
>   File "matplotlib\numerix\__init__.pyc", line 147, in ?
> ImportError: No module named random_array

Did you follow these instructions?

  http://www.py2exe.org/index.cgi/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


-
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] Possible to use SciPy instead of NumPy?

2007-03-27 Thread Robert Kern
Tyler Hayes wrote:
> Ideally I'd like to just make the one call:
> 
> from pylab import *
> 
> Which would load SciPy (& NumPy) automatically

I recommend simply making your own file with all of the imports you need.
Implicitly relying on scipy being the chosen 'numerix' will make your code
difficult to understand.

-- 
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] backends issue

2007-02-21 Thread Robert Kern
Chiara Caronna wrote:
> I have a problem with backend: by default it was Agg; i tried to change the 
> file .matplotlibrc and to put GTKAgg, but as I import pylab I got these 
> errors:

>   File 
> "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_gtk.py", 
> line 6, in ?
> import gobject
> ImportError: No module named gobject
> 
> What can I do?

Install PyGTK.

-- 
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-06 Thread Robert Kern
Christopher Barker wrote:
> Jonathan Kane wrote:
>> The file I downloaded was ScipySuperpack-Intel-10.4-py2.4
>> matplotlib was a part of that package.
> 
> Who built/maintains that package?

Chris Fonnesbeck.  http://trichech.us/?page_id=4

> Anyone know what back-ends it supports?

I only see _ns_backend_agg.so and _tkagg.so so I imagine it only support TkAgg
for the GUI (and possibly whatever backends that don't require extension 
modules).

-- 
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


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


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] 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-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:
> 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
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:
> 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] How do I include the stop value in the array by using arrayrange?

2006-11-17 Thread Robert Kern
[EMAIL PROTECTED] wrote:
> Hi,all:
> How do I include the stop value in the array by using arrayrange?
> Say:
> arrayrange(0,10,1.0,Float)
> [ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9.,]
> but I want 10 to be included

1. arrayrange() is a deprecated name. arange() is the preferred name.

2. However, arange() with floating point numbers is unreliable. Because of
floating point precision issues, it is often difficult to tell whether or not
the endpoint will be included. Use linspace() 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


-
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] tex problem

2006-10-31 Thread Robert Kern
[EMAIL PROTECTED] wrote:
> I tried:
> 
> label='$\textrm{test}_2$
> xlabel(r label)
> xlabel(r+label)
> 
> etc but it not working (like I expected). So I would like to know if there 
> are 
> a way to precise that the text is a raw string by another thing that the r 
> character just before the string. Perhaps that will be good to have an option 
> like raw=true or something similar?

There is no such thing as a raw string *object*. There are only raw string 
*literals*. The r'' determines how the source code is parsed, not how the 
contents of the object is treated.

   label = r'$\textrm{test}_2$'
   xlabel(label)

After the source code containing the string literal is parsed, the string is 
simply a string.

-- 
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


Re: [Matplotlib-users] bug in numerix?

2006-09-26 Thread Robert Kern
[EMAIL PROTECTED] wrote:
> But why the compatibility function is used? Not the new one from numpy? I 
> didn't ask for a Numeric compatibility?
> I don't understand the need to have the Numeric function when I'm using numpy.

The numerix layer is also used internally by matplotlib such that it does not 
need to have three different implementations to support the three array 
packages. It serves to be a uniform layer over the three packages, not just 
serve as a common place to get array functions from. That it is also exposed by 
importing everything from pylab is a side effect. If you don't want this, then 
you can configure ipython to import everything you want from numpy *after* 
pylab.

-- 
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] can't get started

2006-06-02 Thread Robert Kern
David S. wrote:
> I have just installed numpy-0.9.8, scipy-0.4.9, and matplotlib-0.87.2 on a
> Windows machine with Python 2.4.2.  
> 
> When I import pylab, I get some Windows message box indicating an error in
> multiarray.pyd and am kicked out of interactive Python.   

Please paste the exact error message here.

-- 
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