[Matplotlib-users] Please help with 3d scatter plot
I have a function (shown below) that would take a 3D numpy array and plot points in 3D. I recently updated my matplotlib with the latest Enthought Python Distribution and now it doesn't work; I guess matplotlib changed the api a little bit. The first problem arises because there is no matplotlib.axes3d anymore. I can't find the equivalent in the newest version. Can someone help me figure this out? Thanks, Jeremy #=== import matplotlib.pyplot as pyplot import matplotlib.axes3d as p3 def PlotPoints(P): fig = pyplot.figure() ax = p3.Axes3D(fig) ax.plot3D(P[:,0],P[:,1],P[:,2],'.') pyplot.show() return ax - 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=100url=/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Please help with 3d scatter plot
Jeremy Conlin wrote: I have a function (shown below) that would take a 3D numpy array and plot points in 3D. I recently updated my matplotlib with the latest Enthought Python Distribution and now it doesn't work; I guess matplotlib changed the api a little bit. The first problem arises because there is no matplotlib.axes3d anymore. I can't find the equivalent in the newest version. Can someone help me figure this out? The axes3d support has been completely removed in matplotlib 0.98.x Thanks, Jeremy #=== import matplotlib.pyplot as pyplot import matplotlib.axes3d as p3 def PlotPoints(P): fig = pyplot.figure() ax = p3.Axes3D(fig) ax.plot3D(P[:,0],P[:,1],P[:,2],'.') pyplot.show() return ax - 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=100url=/ ___ 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=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Saved PDFs default to 4/3 aspect ratio even if do subplots_adjust?
The size of the figure can be adjusted using figure(figsize=(width, height)) subplots_adjust merely adjusts the margins between multiple subplots within the same figure. Hope that helps. Mike [EMAIL PROTECTED] wrote: I measured the displayed Matplotlib PDF on the screen and noticed it has a 4/3 (1.333...) aspect ratio by default. Is it EXACTLY 4/3? Even if I do: pylab.figure().subplots_adjust(left = EXTRA_ROOM, bottom = EXTRA_ROOM) ??? (Why doesn't the subplots_adjust command seem to mess up the default aspect ratio?? ) Chris - 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=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA - 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=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problems with imshow logarithmic plot
Okay, I can't find where I came up with the original solution to use imshow with custom clevs... I think it was a thread on this forum possibly, or in an example. But the point is that I recall there was some development talk about improving the handling of log data for this issue Does anyone have some pointers on these changes? I guess what you would suggest is that I interpolate the data, then use pcolor to plot it? Thanks. Michael Droettboom-3 wrote: imshow doesn't handle logarithmic data. You'll want to use pcolor or pcolormesh instead. As for the graininess, unfortunately, pcolor and pcolormesh don't support any kind of interpolation. (imshow does, but it can only draw uniform data). Mike John [H2O] wrote: Hello, I'm trying to get imshow to plot logarithmic data. I'm having some problems with the colorbar or data?? Note, I plot the max_dat value on the bottom of the figure, but it does not seem to correspond with the values in the plot??? Any ideas? Also, does anyone have some recommendations on how to better smooth the values, i.e. make the plume less 'grainy'? Thanks! My code is here: http://numpy.pastebin.com/m4ae6331a Example output is here: http://picasaweb.google.com/washakie/Temp#5260746894103850338 -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA - 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=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- View this message in context: http://www.nabble.com/Problems-with-imshow-logarithmic-plot-tp20152686p20190337.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=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problems with imshow logarithmic plot
I should add here also, this doesn't explain for me why the values are different?? Thoughts on that mtter? Thanks!! -- View this message in context: http://www.nabble.com/Problems-with-imshow-logarithmic-plot-tp20152686p20190717.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=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problems with imshow logarithmic plot
The image is being plot in linear scale, while the scatter point is being plotted with log scale...? John [H2O] wrote: I should add here also, this doesn't explain for me why the values are different?? Thoughts on that mtter? Thanks!! -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA - 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=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problems with imshow logarithmic plot
Well, the image is being plotted using: ## create logorithmic scale range_max = int(pl.ceil(dat_max)) step = int(pl.ceil(range_max/10)) logspace = 10.**np.linspace(-1, 4.0, 20) # 50 equally-spaced-in-log points between 1.e-01 and 1.0e03 #plot# im = m.imshow(topodat,cmap=cm.s3pcpn,interpolation='nearest',vmin=dat_min,vmax=dat_max+(0.1*(dat_min-dat_max))) The it is the 'Data Max' text that is of concern. Notice it does not equal the max color according to the scale... the scatter point itself is not of issue. -john Michael Droettboom-3 wrote: The image is being plot in linear scale, while the scatter point is being plotted with log scale...? John [H2O] wrote: I should add here also, this doesn't explain for me why the values are different?? Thoughts on that mtter? Thanks!! -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA - 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=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- View this message in context: http://www.nabble.com/Problems-with-imshow-logarithmic-plot-tp20152686p20191667.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=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Saved PDFs default to 4/3 aspect ratio even if do subplots_adjust?
On Mon, Oct 27, 2008 at 10:59:40AM -0400, Michael Droettboom wrote: The size of the figure can be adjusted using figure(figsize=(width, height)) subplots_adjust merely adjusts the margins between multiple subplots within the same figure. Thanks. subplots_adjust(left=.., bottom=...) seems to have an effect on a single plot too. It lets you add extra room for axis labels. It *must* mess up the aspect ratio of the plot since the axis labels are now stealing extra space right? Chris - 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=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] changing the size of a plot point
is there a way, when plotting many points, to decrease the size of the point. With the default size I end up with overlapping points so some are not displayed. Mathew - 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=100url=/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] changing the size of a plot point
On Mon, Oct 27, 2008 at 01:53:24PM -0700, Mathew Yeates wrote: is there a way, when plotting many points, to decrease the size of the point. With the default size I end up with overlapping points so some are not displayed. Do you want to change (decrease) the following values? plot(range(10), '.-', linewidth=3, markersize=15) # big values for testing I hope that helps. By, Friedrich - 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=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] changing the size of a plot point
Thank you! On Mon, Oct 27, 2008 at 2:12 PM, Friedrich Hagedorn [EMAIL PROTECTED]wrote: On Mon, Oct 27, 2008 at 01:53:24PM -0700, Mathew Yeates wrote: is there a way, when plotting many points, to decrease the size of the point. With the default size I end up with overlapping points so some are not displayed. Do you want to change (decrease) the following values? plot(range(10), '.-', linewidth=3, markersize=15) # big values for testing I hope that helps. By, Friedrich - 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=100url=/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] How to plot only points which lie in a certain range
I'm sorry for this newbie question. I have a data file consisting of 3 columns, and want to plot the first versus the second column, but only if the parameter in the third column lies in a certain range. Does somebody have an idea how to do that? -- View this message in context: http://www.nabble.com/How-to-plot-only-points-which-lie-in-a-certain-range-tp20178863p20178863.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=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] question about figsize keyword of figure(..)
I'm confused about what matplotlib.pyplot.figure(figsize = (a,b)) *means* It appears that the figure gets *bigger* as I make a and b *smaller* !??! Chris - 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=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How to plot only points which lie in a certain range
You need to use the numpy 'where' functionality import numpy as np x, y, z = np.loadtxt(fileName.dat, unpack=True) # or similar # x, y and z are now numpy arrays and have built in functionality as follows: s = (z 10.0) (z**2 0.5) # or some other constraint. Produces an array 's' of boolean values plot(x[s], y[s]) # will plot only those x,y pairs for which s is True marcusantonius [EMAIL PROTECTED] 28/10/2008 09:40 AM To matplotlib-users@lists.sourceforge.net cc Subject [Matplotlib-users] How to plot only points which lie in a certain range I'm sorry for this newbie question. I have a data file consisting of 3 columns, and want to plot the first versus the second column, but only if the parameter in the third column lies in a certain range. Does somebody have an idea how to do that? -- View this message in context: http://www.nabble.com/How-to-plot-only-points-which-lie-in-a-certain-range-tp20178863p20178863.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=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ UNITED GROUP This email message is the property of United Group. The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. If you are not the intended recipient, you may not disclose, copy or distribute this email, nor take or omit to take any action in reliance on it. United Group accepts no liability for any damage caused by this email or any attachments due to viruses, interference, interception, corruption or unauthorised access. If you have received this email in error, please notify United Group immediately by email to the sender's email address and delete this document.- 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=100url=/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] question about figsize keyword of figure(..)
[EMAIL PROTECTED] wrote: I'm confused about what matplotlib.pyplot.figure(figsize = (a,b)) *means* a and b are width and height in inches. For vector backends (svg, ps, pdf), that's all there is to it--unless there is a bug. For non-vector output (screen, *.png), the a, b get translated to pixels based on the figure.dpi (if to the screen) or the savefig.dpi (if to a file). If you display such a file on the screen, or print it, the size will depend on the software used for that display or printing, and this is completely out of mpl's control. (Actually, even for vector output, what you see upon display will depend on the software used for display--acroread, evince, gs, ghostview, etc.--and on how it is configured. But at least the vector output formats specify physical sizes in real units, not arbitrary pixels.) It appears that the figure gets *bigger* as I make a and b *smaller* !??! You will need to be more explicit about what you are doing to reach this conclusion. Eric Chris - 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=100url=/ ___ 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=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] question about figsize keyword of figure(..)
On Mon, Oct 27, 2008 at 6:48 PM, Eric Firing [EMAIL PROTECTED] wrote: It appears that the figure gets *bigger* as I make a and b *smaller* !??! You will need to be more explicit about what you are doing to reach this conclusion. What he is probably seeing comes from the fact that some of the figure elements (line width, font size) are in physical dimensions. As you make the figure size smaller with figsize, these dimensions are unchanged, and so they look bigger in proportion to things that scale proportionately with the figsize, eg the axes area. There is not built-in scaling of these physical dimensions with figsize. JDH - 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=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Redrawing a description of axis
Hi, I'm dealing with a problem how to redraw just label ticks in one certain subplot with in matplotlib. If I change description of axis in the subplot (by .set_yticks() and .set_yticklabels()) I have to redraw whole figure (figure.canvas.draw()) to see the changes. But I need to redraw either just the one subplot with axis' description or just the descriptions. Is it possible to use there something like blit techniques? Thanks for any advice. Czenek - 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=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users