Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread Rob Hetland
On Jul 20, 2007, at 5:53 PM, Christopher Barker wrote: > However, I have seen a real shift on the numpy list over the last year > (or two), toward using the namespace. Yes, I do that to, primarily in scripts. However, for interactive sessions, I usually import into the top namespace. I imagin

Re: [matplotlib-devel] patch to fix examples

2007-07-20 Thread Eric Firing
Stefan van der Walt wrote: > Thanks for applying the patch, Eric. I should also mention that there > are two other problems that my patch didn't solve: Thank you for your patch, and for pointing out the additional problems. > > In agg_resize.py: > > Traceback (most recent call last): > File

Re: [matplotlib-devel] patch to fix examples

2007-07-20 Thread Stefan van der Walt
Thanks for applying the patch, Eric. I should also mention that there are two other problems that my patch didn't solve: In agg_resize.py: Traceback (most recent call last): File "_tmp_agg_resize.py", line 12, in interp = agg.span_interpolator_linear(imMatrix); AttributeError: 'module' ob

Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread Christopher Barker
>> so I think it does make sense to bring the common names that show up in >> math expressions into the main namespace. >> This is probably best just done by each individual according to his/her >> taste. > > That's what I'm trying to get away from. I want to be able to write > the contains()

Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread Paul Kienzle
On Fri, Jul 20, 2007 at 02:53:42PM -0700, Christopher Barker wrote: > Paul Kienzle wrote: > > On Fri, Jul 20, 2007 at 12:34:44PM -0700, Christopher Barker wrote: > >> Out of 491 names in the numpy namespace, I found 26 that would commonly > >> be found in math expressions. > > > The C99 math/com

Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread Christopher Barker
Robert Kern wrote: > Rob Hetland wrote: >> There is also quite a bit of advice on the internet and otherwise >> that 'from numpy import *' is the way to import the library. For >> example, this is the approach in Oliphant's 'Guide to Numpy.' > > You'll often see it in examples because it's th

Re: [matplotlib-devel] rcParams and validation

2007-07-20 Thread Fernando Perez
On 7/20/07, Darren Dale <[EMAIL PROTECTED]> wrote: > On Friday 20 July 2007 05:25:06 pm Fernando Perez wrote: > > I also just (r2528) updated things to use a cleaner import convention: > > I don't like importing things from modules *they* imported. > [...] > > The point is that instead of > > > > -

Re: [matplotlib-devel] rcParams and validation

2007-07-20 Thread Darren Dale
On Friday 20 July 2007 05:25:06 pm Fernando Perez wrote: > I also just (r2528) updated things to use a cleaner import convention: > I don't like importing things from modules *they* imported. [...] > The point is that instead of > > -from mplconfig import MPLConfig, ConfigManager, mkConfigObj > > I

Re: [matplotlib-devel] rcParams and validation

2007-07-20 Thread Fernando Perez
On 7/20/07, Fernando Perez <[EMAIL PROTECTED]> wrote: > On 7/20/07, Darren Dale <[EMAIL PROTECTED]> wrote: > > > > This should give you a very reasonable solution for what you wanted to do. > > > > Great! I'm surprised that this was possible. > > And actually easy, for once. > > > Im attaching a pa

Re: [matplotlib-devel] rcParams and validation

2007-07-20 Thread Fernando Perez
On 7/20/07, Darren Dale <[EMAIL PROTECTED]> wrote: > > This should give you a very reasonable solution for what you wanted to do. > > Great! I'm surprised that this was possible. And actually easy, for once. > Im attaching a patch for the ipython1 sandbox, which adds configobj.py, moves > the ip

Re: [matplotlib-devel] rcParams and validation

2007-07-20 Thread Robert Kern
Fernando Perez wrote: > Am I missing something? No, I just wasn't paying close enough attention. Never mind me. -- 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 underly

Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread Rob Hetland
On Jul 20, 2007, at 2:02 PM, Christopher Barker wrote: > That's why: "Namespaces are one honking great idea". They really are. > Trust me on this. I get namespaces. They are really great. It's just that I use numpy and mpl *so* much that the namespaces get in the way. Most of my (smaller)

Re: [matplotlib-devel] rcParams and validation

2007-07-20 Thread Fernando Perez
On 7/20/07, Robert Kern <[EMAIL PROTECTED]> wrote: > Darren Dale wrote: > > > That is not too bad for small config files, but matplotlib's selection of rc > > parameters is pretty large, and it is nice to have them appear in the file > > in > > a meaningful order. > > You guys may want to consider

Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread Robert Kern
Rob Hetland wrote: > There is also quite a bit of advice on the internet and otherwise > that 'from numpy import *' is the way to import the library. For > example, this is the approach in Oliphant's 'Guide to Numpy.' You'll often see it in examples because it's the only way to make examples

Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread Robert Kern
Paul Kienzle wrote: > Let me rephrase: Can we have a function sqrt(x) which returns real if x is > nonnegative, and complex if it is negative? Similarly for other math > functions > such as log which produce complex values for negative numbers? > > I suppose the numpy list is the place to debat

Re: [matplotlib-devel] rcParams and validation

2007-07-20 Thread Robert Kern
Darren Dale wrote: > That is not too bad for small config files, but matplotlib's selection of rc > parameters is pretty large, and it is nice to have them appear in the file in > a meaningful order. You guys may want to consider iniparse instead of configobj. It will preserve order, indentatio

Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread Paul Kienzle
On Fri, Jul 20, 2007 at 12:34:44PM -0700, Christopher Barker wrote: > You're right that for math expressions, it is nice to have them in the > namespace, so this is used a lot: > > from numpy import sqrt, sin, cos, exp > > Maybe it's a reasonable idea to write a Nmath.py, which would have an >

Re: [matplotlib-devel] Plot with no labels

2007-07-20 Thread John Hunter
On 7/20/07, Gael Varoquaux <[EMAIL PROTECTED]> wrote: > This question really belongs to the user ML, but I don't want to > subscribe to another ML, so please, indulge me. > > I often have a figure with a lot of plot, some of them created in a for > loop. I want some of them to display in the legend

Re: [matplotlib-devel] mpl1 draft

2007-07-20 Thread John Hunter
On 7/20/07, Christopher Barker <[EMAIL PROTECTED]> wrote: > > On Jul 19, 2007, at 12:18 PM, John Hunter wrote: > >> I also plan to use the SWIG agg wrapper > > Where can I find that? I did some googling, and no luck. mpl1/mpl1.py uses it It is available in matplotlib installs as from matplot

[matplotlib-devel] Plot with no labels

2007-07-20 Thread Gael Varoquaux
This question really belongs to the user ML, but I don't want to subscribe to another ML, so please, indulge me. I often have a figure with a lot of plot, some of them created in a for loop. I want some of them to display in the legend, and some of them not to. Now this is possible, using the two

Re: [matplotlib-devel] mpl1 draft

2007-07-20 Thread Christopher Barker
> On Jul 19, 2007, at 12:18 PM, John Hunter wrote: >> I also plan to use the SWIG agg wrapper Where can I find that? I did some googling, and no luck. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point

Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread Christopher Barker
Paul Kienzle wrote: > This is improved somewhat as: > > import numpy as N > res = N.sqrt(2*N.sin(N.pi*x**2) + N.cos(x**2) - N.exp(2*N.pi*1j)) > > but the following is better: > > from mpl.math import * > res = sqrt(2*sin(pi*x**2) + cos(x**2) - exp(2*pi*1j)) quite true. Interestingly, I

Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread Paul Kienzle
On Fri, Jul 20, 2007 at 09:03:21AM -1000, Eric Firing wrote: > Good, thank you. This brings up the larger question of the major > redesign that is underway, and how to make sure we don't lose the > benefit of wonderful speedups like quadmesh. How hard would it be to > translate it to use the s

Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread John Hunter
On 7/20/07, Eric Firing <[EMAIL PROTECTED]> wrote: > ngs up the larger question of the major > redesign that is underway, and how to make sure we don't lose the > benefit of wonderful speedups like quadmesh. How hard would it be to > translate it to use the swig-wrapped version of agg rather than

Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread Paul Kienzle
On Fri, Jul 20, 2007 at 11:02:45AM -0700, Christopher Barker wrote: > Rob Hetland wrote: > > First, it has bothered me that from pylab import * and from numpy > > import * both import 'load' statements. Yes, I realize that I can put > > them in their own name space, but I only use python for mp

Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread Eric Firing
Paul Kienzle wrote: [...] >> Quadmesh has a bug in it that I would love to see squashed. Can you >> look at it, or induce someone else to do so? I tried but couldn't >> figure it out--it is something deep in the use of Agg. It is illustrated >> by examples/quadmesh_demo.py. With masked data (

Re: [matplotlib-devel] rcParams and validation

2007-07-20 Thread Fernando Perez
On 7/20/07, Fernando Perez <[EMAIL PROTECTED]> wrote: > However, it's not all gloom and doom: one can simply generate a config > file from the object description, edit it for ordering, and after that > keep it synced with changes to the object description fairly easily. > The current code only wor

Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread Paul Kienzle
On Fri, Jul 20, 2007 at 06:57:26AM -1000, Eric Firing wrote: > Paul Kienzle wrote: > > On Fri, Jul 20, 2007 at 08:53:30AM -0400, Rob Hetland wrote: > >> Second, much of what I do involves plotting model data (on a > >> curvilinear grid). I generally like to use pcolor for these plots. > >> I

Re: [matplotlib-devel] patch to fix examples

2007-07-20 Thread Eric Firing
Stefan, Thanks. I will apply them shortly, after a bit of checking. (There were commits after 3584, but things look easy enough to straighten out.) Eric Stefan van der Walt wrote: > Hi everyone, > > Some of the examples in the repository are broken. Attached is a > patch to fix them (it al

Re: [matplotlib-devel] rcParams and validation

2007-07-20 Thread Fernando Perez
On 7/20/07, Darren Dale <[EMAIL PROTECTED]> wrote: > Although, the config files generated this way are not very well organized, due > to the seemingly random order that a dict's items are accessed. Look at the > mpl3.conf file that is generated with Fernando's proof-of-concept: > > interactive = F

Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread Eric Firing
Rob Hetland wrote: > On Jul 20, 2007, at 9:07 AM, Paul Kienzle wrote: > >> On Fri, Jul 20, 2007 at 08:53:30AM -0400, Rob Hetland wrote: >>> Second, much of what I do involves plotting model data (on a >>> curvilinear grid). I generally like to use pcolor for these plots. >>> I *always* want shadi

Re: [matplotlib-devel] mpl1 draft

2007-07-20 Thread Christopher Barker
Darren Dale wrote: > Is there much demand for BSD-compliant svg, pdf, and ps backends? Is the demand any different than for any other back end? I wonder about the demand for BSD MPL over all. I know we want people to be able to use MPL in proprietary apps, but the LGPL allows that. How importan

Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread Christopher Barker
Rob Hetland wrote: > First, it has bothered me that from pylab import * and from numpy > import * both import 'load' statements. Yes, I realize that I can put > them in their own name space, but I only use python for mpl and numpy That's why: "Namespaces are one honking great idea". They re

Re: [matplotlib-devel] mpl1 draft

2007-07-20 Thread Christopher Barker
Ken McIvor wrote: >>But is PIL something we plan to depend on? > > I don't know, although I'm warming to the idea myself. Is PIL's DrawAgg numpy-aware? I suspect not. That could make difference when drawing lines with LOTS of points, for instance. I suppose we could contribute the array-aware

[matplotlib-devel] patch to fix examples

2007-07-20 Thread Stefan van der Walt
Hi everyone, Some of the examples in the repository are broken. Attached is a patch to fix them (it also required one or two changes in the rest of matplotlib). I haven't monitored the list for a while, and I'm glad to hear that mpl1 is on the table. I hope automated testing will be one of the

Re: [matplotlib-devel] rcParams and validation

2007-07-20 Thread Darren Dale
On Friday 20 July 2007 12:31:00 pm Brian Granger wrote: > > Damn, that is really cool. So you can generate default config files from > > the MPLConfig instance. We create a default matplotlibrc file from a > > template, setting default backend and numerix values based on what is > > available on th

Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread Eric Firing
Paul Kienzle wrote: > On Fri, Jul 20, 2007 at 08:53:30AM -0400, Rob Hetland wrote: >> Second, much of what I do involves plotting model data (on a >> curvilinear grid). I generally like to use pcolor for these plots. >> I *always* want shading='flat' Some of my grids are large, and I >> on

Re: [matplotlib-devel] rcParams and validation

2007-07-20 Thread Brian Granger
> 3. Traits. We (Brian and I) have gone back and forth a lot on Traits, > and we've come very close to just making them a dependency. The only > real issue holding us back is that ipython so far has exactly *zero* > extension code, which is a plus in terms of ease of > installation/deployment. H

Re: [matplotlib-devel] rcParams and validation

2007-07-20 Thread Brian Granger
> Damn, that is really cool. So you can generate default config files from the > MPLConfig instance. We create a default matplotlibrc file from a template, > setting default backend and numerix values based on what is available on the > users system. It looks like it would be even easier with your

Re: [matplotlib-devel] Numpification - next try

2007-07-20 Thread John Hunter
On 7/20/07, Norbert Nemec <[EMAIL PROTECTED]> wrote: > Hi there, > > I sorted out the reverted commits (sorry once again) and tried another > commit. This time trying to think of everything that was said: > > * the numerix/ directory is unchanged > * code in matplotlib is independent of numerix > *

[matplotlib-devel] Numpification - next try

2007-07-20 Thread Norbert Nemec
Hi there, I sorted out the reverted commits (sorry once again) and tried another commit. This time trying to think of everything that was said: * the numerix/ directory is unchanged * code in matplotlib is independent of numerix * code in matplotlib imports numpy as npy * everything is triple ch

[matplotlib-devel] remove artists

2007-07-20 Thread Paul Kienzle
Hi, Not hearing back one way or the other, I checked in the remove artist stuff. It is a pretty minor patch. It is cheap (a lambda and an attribute per artist), but unfortunately not free for those who don' need it :-( I can turn the lambdas into methods pretty easily if the python experts say

Re: [matplotlib-devel] Apology

2007-07-20 Thread John Hunter
On 7/20/07, Norbert Nemec <[EMAIL PROTECTED]> wrote: > I think I have to apologize, especially to Eric and John, for the > confusion that I caused by the commits yesterday. The whole thing > started as a bit of cleaning up and then I got carried away. Thanks for the apology -- it was a minor inco

Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread Rob Hetland
On Jul 20, 2007, at 9:07 AM, Paul Kienzle wrote: > On Fri, Jul 20, 2007 at 08:53:30AM -0400, Rob Hetland wrote: >> Second, much of what I do involves plotting model data (on a >> curvilinear grid). I generally like to use pcolor for these plots. >> I *always* want shading='flat' Some of my grid

Re: [matplotlib-devel] mpl1 draft

2007-07-20 Thread John Hunter
On 7/20/07, Michael Droettboom <[EMAIL PROTECTED]> wrote: > er concern, though, is that there seems to be no way to update > just a subregion of the PhotoImage from pure Python. I see that the C > code in _tkagg.cpp can do this. Does that actually get used or is it > always a full image? Yes we

Re: [matplotlib-devel] mpl1 draft

2007-07-20 Thread Michael Droettboom
Ken McIvor wrote: > On Jul 20, 2007, at 6:26 AM, Michael Droettboom wrote: >> Ken McIvor wrote: >>> I think PIL's ImageTk module would do the trick for converting RGBA -> >>> PIL Image -> Tk Bitmap/PhotoImage. >> >> That's what I was thinking, too. I don't think there's a way to do this >> in

Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread Paul Kienzle
On Fri, Jul 20, 2007 at 08:53:30AM -0400, Rob Hetland wrote: > Second, much of what I do involves plotting model data (on a > curvilinear grid). I generally like to use pcolor for these plots. > I *always* want shading='flat' Some of my grids are large, and I > only see lines if I don't.

[matplotlib-devel] Polygon examples broken

2007-07-20 Thread Rob Hetland
I just noticed that the example poly_editor.py is broken. It appears to be the Artist.update_from(self.line, poly) that is called when the polygon is changed. The problem is that no change is saved after a subsequent modification. Also, clippath_test.py (that also uses Polygons) appears t

Re: [matplotlib-devel] mpl1 draft

2007-07-20 Thread Ken McIvor
On Jul 20, 2007, at 6:26 AM, Michael Droettboom wrote: > Ken McIvor wrote: >>> >> I think PIL's ImageTk module would do the trick for converting >> RGBA -> >> PIL Image -> Tk Bitmap/PhotoImage. > > That's what I was thinking, too. I don't think there's a way to do > this > in a raw Tkinter. B

Re: [matplotlib-devel] mpl1 draft

2007-07-20 Thread Michael Droettboom
Ken McIvor wrote: >> This means someone needs to figure out how to get TkInter talking to >> a python >> buffer object or a numpy array. > > I think PIL's ImageTk module would do the trick for converting RGBA -> > PIL Image -> Tk Bitmap/PhotoImage. That's what I was thinking, too. I don't think

[matplotlib-devel] Apology

2007-07-20 Thread Norbert Nemec
Hi everybody, I think I have to apologize, especially to Eric and John, for the confusion that I caused by the commits yesterday. The whole thing started as a bit of cleaning up and then I got carried away. I think there were two points that caused confusion. One is that the new revisions woul

Re: [matplotlib-devel] error: package directory 'lib/matplotlib/numerix/mlab' does not exist

2007-07-20 Thread Nils Wagner
Eric Firing wrote: > Nils, > > Two more commits, now at 3584, and I think I have it straightened out. >I hope so. I'm going offline for 8 hours or so, so if it is not > fixed now either someone else will have to do it, or it will have to wait. > > Eric > > Hi Eric, Works for me ! Than

Re: [matplotlib-devel] error: package directory 'lib/matplotlib/numerix/mlab' does not exist

2007-07-20 Thread Eric Firing
Nils, Two more commits, now at 3584, and I think I have it straightened out. I hope so. I'm going offline for 8 hours or so, so if it is not fixed now either someone else will have to do it, or it will have to wait. Eric Nils Wagner wrote: > Eric Firing wrote: >> Nils, >> >> I just committ

Re: [matplotlib-devel] error: package directory 'lib/matplotlib/numerix/mlab' does not exist

2007-07-20 Thread Eric Firing
Nils, Rats! I thought I had svn figured out, but I managed to foul it up. Ok, stand by, I will try to straighten it out. I know what the directory tree should look like, I just don't know exactly how to get svn to do what I want it to do. I will have to undo the last fiasco and try somethin

Re: [matplotlib-devel] error: package directory 'lib/matplotlib/numerix/mlab' does not exist

2007-07-20 Thread Nils Wagner
Eric Firing wrote: > Nils, > > I just committed 3582 which reverted numerix to 3573, so please try > again. It works for me now. > > Eric > > > Nils Wagner wrote: >> Hi, >> >> I cannot install matplotlib from latest svn. >> error: package directory 'lib/matplotlib/numerix/mlab' does not exist >> >

Re: [matplotlib-devel] error: package directory 'lib/matplotlib/numerix/mlab' does not exist

2007-07-20 Thread Eric Firing
Nils, I just committed 3582 which reverted numerix to 3573, so please try again. It works for me now. Eric Nils Wagner wrote: > Hi, > > I cannot install matplotlib from latest svn. > error: package directory 'lib/matplotlib/numerix/mlab' does not exist > > Nils

Re: [matplotlib-devel] rcParams and validation

2007-07-20 Thread Gael Varoquaux
On Wed, Jul 18, 2007 at 11:24:09AM -0600, Brian Granger wrote: > At some level though, configuration is a very different thing than an > application's runtime API. While they may be related (by exposing > common functionality), not everything that can be configured would > appear in a runtime API

Re: [matplotlib-devel] rcParams and validation

2007-07-20 Thread Fernando Perez
On 7/19/07, Darren Dale <[EMAIL PROTECTED]> wrote: > Damn, that is really cool. So you can generate default config files from the > MPLConfig instance. We create a default matplotlibrc file from a template, > setting default backend and numerix values based on what is available on the > users syst