Re: [Matplotlib-users] installation of matplotlib on OS X 10.5 with python.org Python 2.6

2010-07-14 Thread Stephen T .
Hi Friedrich, Thanks so much for your response! > Date: Wed, 7 Jul 2010 20:16:24 +0200 > > Since you are 10.5, I think your default compiler is gcc-4.0 if I'm > not very much mistaken. Can you please verify that by issuing gcc > --version? > > I had a private conversation with the "owner" of

Re: [Matplotlib-users] Basemap contourf question

2010-07-14 Thread Steve McFarlin
Eric - Thank you very much. This is exactly what I was looking to do. I should have realized the levels are boundaries, and my color array was not matched to the number of regions. The need for BoundaryNorm makes total sense. Time to stop blindly hacking. Thanks for your example script. - st

Re: [Matplotlib-users] Basemap contourf question

2010-07-14 Thread Steve McFarlin
Ben - The problem is occurring on os-x. I am a version behind on the libraries on this machine. With the latest libraries (installed a few days ago on debian) this problem does not occur with the agg backend. I think it is time to sit down and learn the library rather then hack at it. Thanks f

Re: [Matplotlib-users] Basemap contourf question

2010-07-14 Thread Eric Firing
On 07/14/2010 12:52 PM, Steve McFarlin wrote: Hello, I am trying to create a color map that maps 18 colors across 50 levels. As an example let say I have three colors [r,g,b] and want everything between 1 an 2 to be r, 3 through 10 to be g, and 11 through 50 to be b. From what I can tell it d

Re: [Matplotlib-users] Basemap contourf question

2010-07-14 Thread Benjamin Root
Steve, Which backend are you using? For TkAgg, this works: m.contourf(x, y, z, levels=levels, cmap=cmap, antialiased=False) Ben Root On Wed, Jul 14, 2010 at 8:00 PM, Steve McFarlin wrote: > Ben - > > I got ahead of myself my cropping the image. The color mapping is correct. > It is just dif

Re: [Matplotlib-users] Basemap contourf question

2010-07-14 Thread Steve McFarlin
Ben - I got ahead of myself my cropping the image. The color mapping is correct. It is just different then what I expected. I thought it would partition the height field data based on the levels array and index into the color array. Turning off antialiasing did not solve the 'ghost lines'. I w

Re: [Matplotlib-users] Basemap contourf question

2010-07-14 Thread Benjamin Root
Steve, The ghost lines appear to be an artifact of the anti-aliasing. In my tests, setting antialiased=False eliminates those lines. The colormap looks fine to me. If you doubt it, try turning on the colorbar to see if the values are correctly associated with the proper colors. Ben Root On W

Re: [Matplotlib-users] Basemap contourf question

2010-07-14 Thread Steve McFarlin
Ben - You can see the image at http://www.surfguru.com/smc/TestRender.png . With a continuous level array [1 .. 18] the image looks like http://www.surfguru.com/smc/TestRender2.png Thanks, Steve On Jul 14, 2010, at 4:12 PM, Benjamin Root wrote: > Steve, > > Could you please attach an exam

Re: [Matplotlib-users] Basemap contourf question

2010-07-14 Thread Benjamin Root
Steve, Could you please attach an example image of what you are seeing? Ben Root On Wed, Jul 14, 2010 at 5:52 PM, Steve McFarlin wrote: > Hello, > > I am trying to create a color map that maps 18 colors across 50 levels. As > an example let say I have three colors [r,g,b] and want everything b

[Matplotlib-users] Basemap contourf question

2010-07-14 Thread Steve McFarlin
Hello, I am trying to create a color map that maps 18 colors across 50 levels. As an example let say I have three colors [r,g,b] and want everything between 1 an 2 to be r, 3 through 10 to be g, and 11 through 50 to be b. From what I can tell it does not seem to be possible. Currently this is w

Re: [Matplotlib-users] matplotlib with psyco

2010-07-14 Thread Eric Firing
On 07/14/2010 11:41 AM, Stephen Evans wrote: > Hi, > > While testing Psyco V2 to see if it would offer any speed improvements I > tried it with some applications using matplotlib. Exceptions were raised > that were easily resolved by replacing calls to min() and max() with > their numpy equivalents

[Matplotlib-users] matplotlib with psyco

2010-07-14 Thread Stephen Evans
Hi, While testing Psyco V2 to see if it would offer any speed improvements I tried it with some applications using matplotlib. Exceptions were raised that were easily resolved by replacing calls to min() and max() with their numpy equivalents numpy.amin() and numpy.amax() in the matplotlib cod

[Matplotlib-users] redrawing plot with transparent background in wx

2010-07-14 Thread Nat Echols
I'm embedding a plot in a wxPython panel, and I'd like it to blend in as much as possible, i.e. the area outside the plot itself should be transparent. I can call figure.figurePatch.set_alpha(0.0) to do this under normal circumstances, but in this case I'm also trying to redraw the plot periodical

Re: [Matplotlib-users] pcolorfast and log axes.

2010-07-14 Thread Eric Firing
On 07/14/2010 06:49 AM, Daniel Welling wrote: > Greetings. > > I've recently found that when I replace pcolor with pcolorfast, the > image will not scale correctly when placed on an axis with a logarithmic > scale. It will remain linear, thus not matching the axis range > whatsoever. The pcolor p

Re: [Matplotlib-users] Probable Bug in Axes.margins()

2010-07-14 Thread Eric Firing
On 07/14/2010 01:29 AM, Georges Schutz wrote: > Hi again, > While looking for a solution for my autoscale issue (see 13/7/2010 > 16:50) I had a look at the matplotlib (1.0.0) source code and found > something strange in axes.py > > In the Axes class the method margins()(Line 1651) the doc string sa

Re: [Matplotlib-users] imshow memory leak in pylab mode?

2010-07-14 Thread K . -Michael Aye
On 2010-07-14 18:51:26 +0200, K.-Michael Aye said: > On 2010-07-14 18:45:35 +0200, John Hunter said: > >> On Wed, Jul 14, 2010 at 11:38 AM, K.-Michael Aye >> wrote: >> >>> Out[12]: 1 >>> >>> In [13]: gc.collect() >>> >>> Out[13]: 12 >> >> >> still not seeing a leak in your data -- you need

Re: [Matplotlib-users] imshow memory leak in pylab mode?

2010-07-14 Thread K . -Michael Aye
On 2010-07-14 18:45:35 +0200, John Hunter said: > On Wed, Jul 14, 2010 at 11:38 AM, K.-Michael Aye > wrote: > >> Out[12]: 1 >> >> In [13]: gc.collect() >> >> Out[13]: 12 > > > still not seeing a leak in your data -- you need to report_memory > after calling gc collect. Turn off hold, add a

[Matplotlib-users] pcolorfast and log axes.

2010-07-14 Thread Daniel Welling
Greetings. I've recently found that when I replace pcolor with pcolorfast, the image will not scale correctly when placed on an axis with a logarithmic scale. It will remain linear, thus not matching the axis range whatsoever. The pcolor plot will still fit nicely in the axis object, but the tic

Re: [Matplotlib-users] imshow memory leak in pylab mode?

2010-07-14 Thread John Hunter
On Wed, Jul 14, 2010 at 11:38 AM, K.-Michael Aye wrote: > Out[12]: 1 > > In [13]: gc.collect() > > Out[13]: 12 still not seeing a leak in your data -- you need to report_memory after calling gc collect. Turn off hold, add an image, call collect, report memory, the repeat several times, each ti

Re: [Matplotlib-users] imshow memory leak in pylab mode?

2010-07-14 Thread K . -Michael Aye
>> 6 : ax.images >> 7 : im = imshow(data) >> 8 : ax.images >> 9 : ax.images.remove[0] >> 10: del ax.images.remove[0] > > Both of these lines are wrong. You either need to do > > ax.images.remove(0) # note the parens, not square brackets > > or > > del ax.images[0] *doh*, of course, me stu

Re: [Matplotlib-users] imshow memory leak in pylab mode?

2010-07-14 Thread John Hunter
On Wed, Jul 14, 2010 at 10:18 AM, K.-Michael Aye wrote: > On 2010-07-14 01:46:49 +0200, John Hunter said: > >> On Mon, Jul 12, 2010 at 5:06 PM, K.-Michael Aye >> wrote: >>> On 2010-07-12 23:17:19 +0200, John Hunter said: >>> On Mon, Jul 12, 2010 at 4:06 PM, K.-Michael Aye wrote: >

[Matplotlib-users] Tip for savefig scripts and memory issues

2010-07-14 Thread K . -Michael Aye
Dear all, just a small tip for all who are creating many images by using something like this: for param in range(10): data = get_data(param) fig = plt.figure() ax = fig.add_subplot(111) im = ax.imshow(data) fig.savefig('data_'+str(param)+'.png) # p

Re: [Matplotlib-users] imshow memory leak in pylab mode?

2010-07-14 Thread K . -Michael Aye
On 2010-07-14 01:46:49 +0200, John Hunter said: > On Mon, Jul 12, 2010 at 5:06 PM, K.-Michael Aye > wrote: >> On 2010-07-12 23:17:19 +0200, John Hunter said: >> >>> On Mon, Jul 12, 2010 at 4:06 PM, K.-Michael Aye >>> wrote: Dear all, I'm not sure if this is by design or a probl

[Matplotlib-users] Probable Bug in Axes.margins()

2010-07-14 Thread Georges Schutz
Hi again, While looking for a solution for my autoscale issue (see 13/7/2010 16:50) I had a look at the matplotlib (1.0.0) source code and found something strange in axes.py In the Axes class the method margins()(Line 1651) the doc string says that using margins() with no arguments should retur

[Matplotlib-users] problem with twinx and autofmt_xdate

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