Re: [Matplotlib-users] Trouble with imshow

2011-02-08 Thread Eric Firing
On 02/08/2011 02:39 PM, Christoph Gohlke wrote: > > > Please consider the attached patch for the _image.frombyte function. It > avoids temporary copies in case of non-contiguous input arrays. Copying > a 1024x1024 slice out of a contiguous 4096x4096 RGBA or RGB array is > about 7x faster (a common

Re: [Matplotlib-users] Multiple mplot3d figures: new plots display over old ones?

2011-02-08 Thread Benjamin Root
On Tue, Feb 8, 2011 at 5:53 PM, Paul Leopardi wrote: > Hi Ben, > On Wed, 9 Feb 2011 03:15:19 AM you wrote: > > As formatted, the code would not run. I presume that everything after > "for > > j in range(0,M):" should be indented? When I did that and ran it in > > ipython, I could not reproduce y

Re: [Matplotlib-users] properties of patch of an axes instance.

2011-02-08 Thread Curiouslearn
Thanks again, Paul! Now I understand. I tried your example and I can see the effect of those commands. On Tue, Feb 8, 2011 at 7:29 PM, Paul Ivanov wrote: > Curiouslearn, on 2011-02-08 19:04,  wrote: >> I wonder then what edgecolor, linewidth etc. change in case of axes.patch. > > They do what o

Re: [Matplotlib-users] Trouble with imshow

2011-02-08 Thread Christoph Gohlke
On 2/5/2011 1:02 PM, Eric Firing wrote: On 02/04/2011 02:03 PM, Christoph Gohlke wrote: [...] How about these changes to color.py (attached). This avoids copies, uses in-place operations, and calculates single precision when normalizing small integer and float32 arrays. Similar could be done

Re: [Matplotlib-users] properties of patch of an axes instance.

2011-02-08 Thread Paul Ivanov
Curiouslearn, on 2011-02-08 19:04, wrote: > I wonder then what edgecolor, linewidth etc. change in case of axes.patch. They do what one would expect, but the spines were likely preventing you from seeing this: ax = plt.subplot(1,1,1) [s.set_visible(False) for s in ax.spines.values()] ax.patch.se

Re: [Matplotlib-users] properties of patch of an axes instance.

2011-02-08 Thread Curiouslearn
Thanks very much Paul. This worked great. I wonder then what edgecolor, linewidth etc. change in case of axes.patch. Thanks again. On Tue, Feb 8, 2011 at 6:22 PM, Paul Ivanov wrote: > Curiouslearn, on 2011-02-08 15:32,  wrote: >> Sorry if the subject line does not use correct terminology. But t

Re: [Matplotlib-users] Multiple mplot3d figures: new plots display over old ones?

2011-02-08 Thread Paul Leopardi
Hi Ben, On Wed, 9 Feb 2011 03:15:19 AM you wrote: > As formatted, the code would not run. I presume that everything after "for > j in range(0,M):" should be indented? When I did that and ran it in > ipython, I could not reproduce your problem. What version of matplotlib > are you running? Thank

Re: [Matplotlib-users] properties of patch of an axes instance.

2011-02-08 Thread Paul Ivanov
Curiouslearn, on 2011-02-08 15:32, wrote: > Sorry if the subject line does not use correct terminology. But the > following explains the question I have: > Suppose I have the following code: > > import matplotlib.pyplot as plt > > fig1 = plt.figure() > ax1 = fig1.add_subplot(1,1,1) > > ax1.scat

[Matplotlib-users] properties of patch of an axes instance.

2011-02-08 Thread Curiouslearn
Sorry if the subject line does not use correct terminology. But the following explains the question I have: Suppose I have the following code: import matplotlib.pyplot as plt fig1 = plt.figure() ax1 = fig1.add_subplot(1,1,1) ax1.scatter(xvalues, yvalues) ax1.axvline(1.3, color='DarkGreen') rect

Re: [Matplotlib-users] [PyQt] refresh 3dplot

2011-02-08 Thread Massimo Di Stefano
ok :-) i find a solution .. maybe correct : in the __init__ i added : self.a = None then in "on_draw" : if self.a is not None: self.axes.collections.remove(self.a) self.a = self.axes.plot_surface(x, y, z, rstride=res, cstride=res, facecolors=colors) now the plot i

Re: [Matplotlib-users] description: unknown (?!?!?)

2011-02-08 Thread Eric Firing
On 02/08/2011 06:42 AM, Benjamin Root wrote: > > > On Thu, Feb 3, 2011 at 9:19 AM, Gf B > wrote: > > In many places in the mpl docs there are tables of supported "kwarg > properties" containing at least one (usually many) entries where the > description g

Re: [Matplotlib-users] description: unknown (?!?!?)

2011-02-08 Thread Benjamin Root
On Thu, Feb 3, 2011 at 9:19 AM, Gf B wrote: > In many places in the mpl docs there are tables of supported "kwarg > properties" containing at least one (usually many) entries where the > description given for the property is simply "unknown". What's up with > that??? How can the description of

Re: [Matplotlib-users] Multiple mplot3d figures: new plots display over old ones?

2011-02-08 Thread Benjamin Root
On Mon, Feb 7, 2011 at 5:02 AM, Paul Leopardi wrote: > Hi all, > On Sun, 6 Feb 2011 03:54:48 PM Paul Leopardi wrote: > > I'm having trouble using multiple figures with mplot3d. > > I have appended an entire example script, below. > > The script incrementally plots 3 curves, one in each of 3 figure

Re: [Matplotlib-users] adjust axis to display array values

2011-02-08 Thread Benjamin Root
On Tue, Feb 8, 2011 at 8:27 AM, Massimo Di Stefano wrote: > Hi Benjamin, > > have you reied the mat file ? > > i treid using a simple python array in a 2d plot and i'm having the same > behavioure > the x,y coordinates are displayed ok when the mouse roll over the graph > but they are wrong in

Re: [Matplotlib-users] ipython -pylab segmentation fault

2011-02-08 Thread Philippe Baucour
Le Tue, 08 Feb 2011 09:14:22 -0500, Michael Droettboom a écrit : > I have seen this problem when matplotlib wasn't fully rebuilt after > upgrading Numpy. I would assume, since you're installing from Gentoo > packages, that the package manager is smart enough to blitz the > matplotlib build pr

[Matplotlib-users] refresh 3dplot

2011-02-08 Thread Massimo Di Stefano
hello All have you never tried to embed a matplotlib 3d graph inside pyqt ? i'm tring to do it .. but i've problenms to refresh my plot. The 3d data are displayed ok inside a pyqt simple widget, but if i try to redraw the image (re-call the on_draw function) ... i have it overlay the previous

Re: [Matplotlib-users] set ncol for legend

2011-02-08 Thread Benjamin Root
On Tue, Feb 8, 2011 at 7:50 AM, sanders wrote: > I realize that I have not been clear enough. > > I have already created a legend instance in my_own_plot_function, for > example, a legend with one column by default: > > fig = plt.figure() > ax = fig.add_subplot(111) > my_own_plot_function(ax, da

Re: [Matplotlib-users] Histogram - dots/circle markers

2011-02-08 Thread Benjamin Root
On Tue, Feb 8, 2011 at 6:53 AM, Curiouslearn wrote: > Hello, > > Matplotlib is so cool. I wish I had spent time learning it earlier. > Better late than never. Thanks so much to all who have worked on > developing it. > > I had a question on histograms. Instead of the bars in case of > histograms,

Re: [Matplotlib-users] adjust axis to display array values

2011-02-08 Thread Massimo Di Stefano
Hi Benjamin, have you reied the mat file ? i treid using a simple python array in a 2d plot and i'm having the same behavioure the x,y coordinates are displayed ok when the mouse roll over the graph but they are wrong in the axis labels. Il giorno 05/feb/2011, alle ore 09.23, Massimo Di St

Re: [Matplotlib-users] ipython -pylab segmentation fault

2011-02-08 Thread Michael Droettboom
I have seen this problem when matplotlib wasn't fully rebuilt after upgrading Numpy. I would assume, since you're installing from Gentoo packages, that the package manager is smart enough to blitz the matplotlib build products before rebuilding, but maybe not. (Python distutils doesn't do pro

Re: [Matplotlib-users] set ncol for legend

2011-02-08 Thread Thomas Lecocq
Bram, Although I don't quite see the point, I would simply suggest that you re-call ax.legend(ncol=2) , that would delete the previous and redraw a new one from matplotlib doc: When the legend command is called, a new legend instance is created and old ones are removed from the axes.

Re: [Matplotlib-users] set ncol for legend

2011-02-08 Thread sanders
I realize that I have not been clear enough. I have already created a legend instance in my_own_plot_function, for example, a legend with one column by default: fig = plt.figure() ax = fig.add_subplot(111) my_own_plot_function(ax, data)# gives, for example, one column legend by default So

[Matplotlib-users] ipython -pylab segmentation fault

2011-02-08 Thread Philippe Baucour
hello, I get a segmentation fault with the pylab mode and I made several test to track down a bug but it's beyond my level and I still don't now if it's an ipython bug or matplotlib bug ... let's reproduce the bug / try 1 Qt4Agg \_ phil@Numokh ~ % ipython -py

[Matplotlib-users] Histogram - dots/circle markers

2011-02-08 Thread Curiouslearn
Hello, Matplotlib is so cool. I wish I had spent time learning it earlier. Better late than never. Thanks so much to all who have worked on developing it. I had a question on histograms. Instead of the bars in case of histograms, is there a way to get circle markers, where each marker represents

Re: [Matplotlib-users] Autoscale AxesImage after using set_data()

2011-02-08 Thread Christoph Bersch
On 08.02.2011 13:01, Thomas Lecocq wrote: > > this could work ; > > img.set_extent([0,200,0,200]) Yes, this works. Thank you. So now I use ax.relim() ax.autoscale_view() img.set_extent([0, 200, 0, 200]) From my point of view it is strange, that one has to call img.set_extent explicitely which

Re: [Matplotlib-users] Autoscale AxesImage after using set_data()

2011-02-08 Thread Thomas Lecocq
Christoph, this could work ; img.set_extent([0,200,0,200]) HTH Thom ** Thomas Lecocq Geologist Ph.D.Student (Seismology) Royal Observatory of Belgium ** > Date: Tue, 8 Feb 2011 12:56:21 +0100 > From: use...@bersch.net > To: thlec...@msn.com > CC: m

Re: [Matplotlib-users] Autoscale AxesImage after using set_data()

2011-02-08 Thread Christoph Bersch
On 08.02.2011 10:23, Thomas Lecocq wrote: > I would suggest calling requet_redraw() ... I could not find such a method, nor any similar one: request_redraw() or *_redraw(). I grepped through the version 1.0.1 source code. Christoph ---

Re: [Matplotlib-users] set ncol for legend

2011-02-08 Thread Thomas Lecocq
Bram, fig = plt.figure() ax = fig.add_subplot(111) plot1 = plot.plot(X,Y,label='1') plot2 = plot.plot(X,Y,label='2') ... plotN = plot.plot(X,Y,label='N') legend = plt.legend(ncol=2) should work... so, for your "own_plot_function", you have to return the legend and set it accordingly...

[Matplotlib-users] set ncol for legend

2011-02-08 Thread sanders
Hi, I want to update the number of columns in my legend. How should I do that? I'm looking for something like: fig = plt.figure() ax = fig.add_subplot(111) my_own_plot_function(ax, data)# gives, for example, one column legend by default legend = ax.get_legend() /legend.set_ncol(2)/

[Matplotlib-users] Autoscale AxesImage after using set_data()

2011-02-08 Thread Christoph Bersch
Hi, I'm trying to autoscale an AxesImage after having set new data with set_data(). I thought, the way to do it is to use Axes.relim() followed by Axes.autoscale_view(). Unfortunately, this does not work properly both with version 0.99.3 and 1.0.1. Consider the following example (adapted from t