Re: [Matplotlib-users] wxmpl incompatibility with matplotlib 0.98.x
I'm not aware of the problem (but I'm not a regular wxmpl user). From 0.91 to 0.98, a major refactoring was done to make it easier to add new kinds of projections. So PolarAxes is no longer a special case, it is just one of many possible non-Cartesian projections. Unfortunately to do this, the API had to change in a number of places. These are documented in the API_CHANGES file in the "TRANSFORMS REFACTORING" section. wxmpl needs to be updated based on those instructions in order to be compatible with mpl 0.98. Hopefully that process won't be too difficult, but it's hard to say without trying. basemap, a fairly large mpl toolkit, was able to handle the transition fairly smoothly. Let me know if I can be of further assistance. Cheers, Mike massimo sandal wrote: > Hi, > > Sorry if bothering you. Here we use a software (that I've written) > that is based on wxmpl and matplotlib, among other things. A collegue > of mine noticed a problem when installing it on Windows, with the > following error: > > File "hooke.py", line 21, in > import wxmpl > File "C:\Python25\lib\site-packages\wxmpl.py", line 26, in > from matplotlib.axes import PolarAxes, _process_plot_var_args > ImportError: cannot import name PolarAxes > > He was using matplotlib 0.98.3 .Downgrading to 0.91 solved the issue. > I remember the same happened when, some month ago, I tried to install > the same software on OS X using what were basically SVN versions of > mpl, labeled "0.98pre" (see http://macinscience.org/?page_id=6 ) > > I guess you are probably aware of the problem: are you already working > on it :) ? Is there any workaround? > > I'd like to help you patching it, if within my skills, but I'd need > some direction on how the mpl API have been updated. > > m. > - > 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 > - 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] Contour/Contourf Plot Heatmap - Grid - Multiple Items
That looks perfect, how did you do it? Thanks kippertoffee wrote: > > here's an example of pcolormesh on a random 10x10 array > > http://www.nabble.com/file/p18874393/spam2.png > > > stuartornum wrote: >> >> Hi Pete, >> >> Thanks for the quick response. >> >> Will imshow() actually plot the graph? >> >> Do I not need to do something like: >> >> contourf(X, Y, Z, levels) >> >> Thanks >> > > -- View this message in context: http://www.nabble.com/Contour-Contourf-Plot-Heatmap---Grid---Multiple-Items-tp18872991p18874605.html Sent from the matplotlib - users mailing list archive at Nabble.com. - 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
[Matplotlib-users] wxmpl incompatibility with matplotlib 0.98.x
Hi, Sorry if bothering you. Here we use a software (that I've written) that is based on wxmpl and matplotlib, among other things. A collegue of mine noticed a problem when installing it on Windows, with the following error: File "hooke.py", line 21, in import wxmpl File "C:\Python25\lib\site-packages\wxmpl.py", line 26, in from matplotlib.axes import PolarAxes, _process_plot_var_args ImportError: cannot import name PolarAxes He was using matplotlib 0.98.3 .Downgrading to 0.91 solved the issue. I remember the same happened when, some month ago, I tried to install the same software on OS X using what were basically SVN versions of mpl, labeled "0.98pre" (see http://macinscience.org/?page_id=6 ) I guess you are probably aware of the problem: are you already working on it :) ? Is there any workaround? I'd like to help you patching it, if within my skills, but I'd need some direction on how the mpl API have been updated. m. -- Massimo Sandal , Ph.D. University of Bologna Department of Biochemistry "G.Moruzzi" snail mail: Via Irnerio 48, 40126 Bologna, Italy email: [EMAIL PROTECTED] web: http://www.biocfarm.unibo.it/samori/people/sandal.html tel: +39-051-2094388 fax: +39-051-2094387 begin:vcard fn:Massimo Sandal n:Sandal;Massimo org:University of Bologna;Department of Biochemistry adr:;;Via Irnerio 48;Bologna;;40126;Italy email;internet:[EMAIL PROTECTED] tel;work:+39-051-2094388 tel;fax:+39-051-2094387 x-mozilla-html:FALSE version:2.1 end:vcard - 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] Contour/Contourf Plot Heatmap - Grid - Multiple Items
here's an example of pcolormesh on a random 10x10 array http://www.nabble.com/file/p18874393/spam2.png stuartornum wrote: > > Hi Pete, > > Thanks for the quick response. > > Will imshow() actually plot the graph? > > Do I not need to do something like: > > contourf(X, Y, Z, levels) > > Thanks > -- View this message in context: http://www.nabble.com/Contour-Contourf-Plot-Heatmap---Grid---Multiple-Items-tp18872991p18874393.html Sent from the matplotlib - users mailing list archive at Nabble.com. - 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
[Matplotlib-users] clip_on vs clip_box
What is the difference between setting clip_on and clip_box? For an annotation, there does not appear to be any difference. But if I give the annotation a bbox, then only clip_box works to clip the box at the axes boundary. The example below demonstrates: from matplotlib.pyplot import figure, show fig = figure() ax = fig.add_subplot(111) ax.annotate('This is a long annotation', xy=(1, 1), clip_on=True, bbox=dict(facecolor = 'white', clip_on=True)) #clip_box = ax.bbox)) ax.set_xlim(-5, 2.8) ax.set_ylim(-5, 5) show() PS. I am using MPL 0.98.3. - 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] Contour/Contourf Plot Heatmap - Grid - Multiple Items
Hi Pete, Thanks for the quick response. Will imshow() actually plot the graph? Do I not need to do something like: contourf(X, Y, Z, levels) Thanks -- View this message in context: http://www.nabble.com/Contour-Contourf-Plot-Heatmap---Grid---Multiple-Items-tp18872991p18874222.html Sent from the matplotlib - users mailing list archive at Nabble.com. - 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] Installation woes: phantom Numpy version?
> On Wed, Aug 6, 2008 at 5:02 PM, Richard Lawrence <[EMAIL PROTECTED]> wrote: >> My setup is: >> Mac Pro PPC G5, OS X 10.5.4 >> Python 2.5.1 (Apple build) >> Numpy 1.2.0.dev5615 -- ran svn update and rebuilt this morning >> REQUIRED DEPENDENCIES >> ~* numpy 1.1 or later is required; you have >> ~* 1.0.5.dev4673 Apple distributed a version of numpy with the system python, and set up sys.path so that their stuff would be found before site-packages, so you may be getting Apple's version of numpy rather than the one you built and installed. (I'm not running 10.5, so I can't supply details) There are ways to work around this -- a little googling should help you figure it out, but I recommend that you avoid the whole problem (and others) by installing python.org's build of 2.5.2, and go from there -- the binaries on the numpy site are built for that version. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] - 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] Contour/Contourf Plot Heatmap - Grid - Multiple Items
Someone more knowlegeable than me may corrct me here, but the code for getting your data into a grid could be greatly simplified to: X = array([0,1,2,3,4,5,6,7,8,9,]) Y = array([0,1,2,3,4,5,6,7,8,9,]) Z = ListValues.reshape(10,10) than you could use something like imshow() to show the data without any interpolation. Pete. 2008/8/7 stuartornum <[EMAIL PROTECTED]> > > Hi, > > I have been using matplotlib for about 2 weeks now. I thought it would be > good to try plotting heatmaps to show some data. > > The idea: > > I have 100 values all ranging from 0.00 to 1.00, I would like to create a > graph with a 10 by 10 grid. Therefore each value has 1 section of the grid. > > So, for example if the value was 0.10, the colour would be blue, or if > 0.95, > the colour red. > > Now the problem is I do not know how to access each individual grid > position, I guess I would have some form of counter system to count 0 -> 9 > on the X axis and 0 -> 9 on the Y also. > > Here is my pseudo code: > > ## > > Count1 = 0 ## For the X axis > Count2 = 0 ## For the Y axis > Max = 0 ## To count 0 - 99 > > ListValues = [0.11, 0.09, 0.34, 0.44, 0.29, all the way to 100 values] > > while Max < 100: > >if Count1 == 10: >Count2 = Count2 + 1 ## Increase the Y axis by one >Count1 = 0 ## If X axis counter = 10, reset > it to 0 >else: >GridPosition = [] >GridPosition.append(Count1) >GridPosition.append(Count2) >GridValue = ListValues[Max] > ># Now armed with the GridPosition and GridValue, im stuck on > how to plot the square... > > ## > > So as you can see from above, I have the data ready to fill the relevant > grid position, just unsure on how to actually do it! > > Just to clarify, this is a heatmap, so the GridValue should correspond to a > colour and fill that particular square with the colour from the colorbar > i.e. > > levels = arange(0.0, 1.0, 0.025) > > Thank you in advance for any help. > -- > View this message in context: > http://www.nabble.com/Contour-Contourf-Plot-Heatmap---Grid---Multiple-Items-tp18872991p18872991.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > - > 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 > - 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
[Matplotlib-users] Contour/Contourf Plot Heatmap - Grid - Multiple Items
Hi, I have been using matplotlib for about 2 weeks now. I thought it would be good to try plotting heatmaps to show some data. The idea: I have 100 values all ranging from 0.00 to 1.00, I would like to create a graph with a 10 by 10 grid. Therefore each value has 1 section of the grid. So, for example if the value was 0.10, the colour would be blue, or if 0.95, the colour red. Now the problem is I do not know how to access each individual grid position, I guess I would have some form of counter system to count 0 -> 9 on the X axis and 0 -> 9 on the Y also. Here is my pseudo code: ## Count1 = 0 ## For the X axis Count2 = 0 ## For the Y axis Max = 0 ## To count 0 - 99 ListValues = [0.11, 0.09, 0.34, 0.44, 0.29, all the way to 100 values] while Max < 100: if Count1 == 10: Count2 = Count2 + 1 ## Increase the Y axis by one Count1 = 0 ## If X axis counter = 10, reset it to 0 else: GridPosition = [] GridPosition.append(Count1) GridPosition.append(Count2) GridValue = ListValues[Max] # Now armed with the GridPosition and GridValue, im stuck on how to plot the square... ## So as you can see from above, I have the data ready to fill the relevant grid position, just unsure on how to actually do it! Just to clarify, this is a heatmap, so the GridValue should correspond to a colour and fill that particular square with the colour from the colorbar i.e. levels = arange(0.0, 1.0, 0.025) Thank you in advance for any help. -- View this message in context: http://www.nabble.com/Contour-Contourf-Plot-Heatmap---Grid---Multiple-Items-tp18872991p18872991.html Sent from the matplotlib - users mailing list archive at Nabble.com. - 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] Installation woes: phantom Numpy version?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 John, Thanks for your help. | | Most likely there is another version of numpy on your system that easy | install is picking up (multiple versions of python perhaps?). You | might try to find them with | | > find / -name numpy -type d | Indeed, this did turn up another installation, and I am now searching for a third, even older one. I wish I understood the layout of /Library better...or that there was only a single site-packages directory for each version of Python :) Once I weed them all out, I will give the egg another shot. I would still like to be able to build it from source, though, so I can stay up to date. | Did you edit setupext.py to remove the basedir settings ans Charlie | recommended? Also, let's make sure that the files in your ld path are | there and of the right type? What does | | > file /usr/local/src/mpl-build/libpng-1.2.29/libpng* | | return? I did in fact edit setupext.py, and the 'darwin' key of basedir is set to an empty list. The file command does report universal binaries for libpng*; the relevant output lines are: libpng-1.2.29/libpng.a:Mach-O universal binary with 2 architectures libpng-1.2.29/libpng.a (for architecture i386): current ar archive random library libpng-1.2.29/libpng.a (for architecture ppc): current ar archive random library (There are similar messages for the various .o and .lo files.) | One other option is to try following the build instructions I posted | at http://ipython.scipy.org/moin/Py4Science/InstallationOSX Actually, the reason I went with the "whole hog" method of compiling libpng and freetype from source was that I was running into a similar architecture error when I tried compiling against the freetype and libpng in /usr/X11R6. Perhaps there is some deeper include path issue that I can't see? - -- Richard Lawrence Research Coordinator Computational Memory Lab [EMAIL PROTECTED] 215-746-0407 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkibA/QACgkQCWv7yMGrSa/s0gCfe5/0oyGIHWq+z7cNuJc1lYaJ unwAniu5qwOwTXaKpjegPjnX5PBBJTlP =RUYR -END PGP SIGNATURE- - 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
[Matplotlib-users] irregularly spaced grids and imshow....
Hello everybody, we are looking for the best way to plot a waterfall diagram in Matplotlib. The 2 functions which could be used to do that are (as far as I have found) imshow and pcolormesh. Here is a small script that use both to compare the output: - from pylab import * delta = 0.2 x = arange(-3.0, 3.0, delta) y = arange(-2.0, 2.0, delta) X, Y = meshgrid(x, y) Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0) Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1) # difference of Gaussians Z = 10.0 * (Z2 - Z1) figure(1) im = imshow(Z,extent=(-3,3,-2,2)) CS = contour(X, -Y, Z, 6, colors='k', # negative contours will be dashed by default ) clabel(CS, fontsize=9, inline=1) title('Using imshow') figure(2) im = pcolormesh(X,-Y,Z) CS = contour(X, -Y, Z, 6, colors='k', # negative contours will be dashed by default ) clabel(CS, fontsize=9, inline=1) title('Using pcolormesh') show() - The problem is that we need some of the flexibility of pcolormesh (which is able to map the matrix of value on any deformed mesh), while we would like to use the interpolations available in imshow (which explain why the imshow version is much "smoother" than the pcolormesh one). In fact, what would be needed is not the full flexibility of pacolormesh (which can map the grid to any kind of shape), we "only" have to deal with rectangular grids with irregularly spaced x- and y- graduations. Is there a drawing function in Matplotlib which would be able to work with such a rectangular non-uniform grid? And if not, what about an extension of imshow which would work as this: im = imshow(Z,x_gridpos=x, y_gridpos=y) #specify explicitely the position of the grid's node, instead of giving the extend and assuming uniform spacing. Longer term, would a pcolormesh accepting interpolation be possible? The current behavior, averaging the color of the grids node to get a uniform cell color, is quite rough except for a large number of cells...And even then, it soon shows when you zoom in... The best would be to allow the same interpolations as in imshow (or a subset of it), and also allows to use interpolation before colormap lookup (or after), like in Matlab. Indeed, Matlab allows to finely tune interpolation by specifying Gouraud (interpolation after color lookup)/Phong(interpolation before color lookup, i.e. for each pixel). Phong is usually much better but also more CPU intensive. Phong is especially when using discrete colormap, producing banded colors equivalent to countour lines, while Gouraud does not work in those cases. Of course, the performance will be impacted by some of those interpolation options, which would degrade performance in animations for example but I think that having the different options available would be very useful, it allows to have the highest map quality, or have a "quick and dirty" map depending on situation (grid spacing, type of map, animation or not, ...). Best regards, Greg. - 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