[Matplotlib-users] colorbar() fix limit on Heat map
Hi All, You may remember from my previous post I was having problems plotting a heatmap, however Pete came through for me and made it work. Anyway, I have almost finished what I want to do. The only issue is fixing the colorbar() range limit. Sometimes the my values are 0.01 to 0.2 for example, and other times there 0.01 to 0.99. So what happens it the colorbar() automagically adjusts the gradient according to my values, however I do not want it to do that, I want the graph to be consistantly 0 - 1 (blue - red). I have tried things like colorbar(0,1), however no luck. If you could let me know how to fix the range, I would be very grateful. Regards -- View this message in context: http://www.nabble.com/colorbar%28%29-fix-limit-on-Heat-map-tp18923300p18923300.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] colorbar() fix limit on Heat map
stuartornum wrote: Hi All, You may remember from my previous post I was having problems plotting a heatmap, however Pete came through for me and made it work. Anyway, I have almost finished what I want to do. The only issue is fixing the colorbar() range limit. Sometimes the my values are 0.01 to 0.2 for example, and other times there 0.01 to 0.99. So what happens it the colorbar() automagically adjusts the gradient according to my values, however I do not want it to do that, I want the graph to be consistantly 0 - 1 (blue - red). I have tried things like colorbar(0,1), however no luck. If you could let me know how to fix the range, I would be very grateful. Regards Stuart: Use the vmin/vmax keyword arguments if your are using imshow or pcolor/pcolormesh. If you are using contourf, just specify the contour levels to span the range 0-1 (i.e. clevs=linspace(-1,1,15)). -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1FAX : (303)497-6449 325 BroadwayBoulder, CO, USA 80305-3328 - 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] colorbar() fix limit on Heat map
stuartornum wrote: Jeff, That worked perfectly ! Thank you. One more question... how would I change the colour scheme of the colorbar()? Thanks again Stuart: Use the cmap argument to specify a color map. Have you checked out the pylab examples? For me, they are the best way to learn how to use matplotlib effectively. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1FAX : (303)497-6449 325 BroadwayBoulder, CO, USA 80305-3328 - 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] SVG and pdf
Hi! This may be a pdf issue or an SVG issue and have nothing to do with matplotlib. If so, sorry... Whenever I produce a figure with matplotlib and 'crop it' using the axis command the svg comes out fine. However, when I save this svg to pdf using inkscape's 'cairo' backend the part of the data that was 'cropped' becomes visible in the pdf. e.g. if I had plotted data from x = -2 to +10, and then I set the axes to only show the data from +3 to +6, the svg comes out fine, but the pdf shows the rest of the graph leaking out from the axes. I currently have to manually crop my data to prevent this. Thanks! -K - 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] SVG and pdf
Sounds like a Inkscape/Cairo issue to me, if the PDF it converts doesn't match the SVG. That said, SVG is tricky to get right, and we may be able to produce things in a different way that Inkscape will handle correctly. I'll look into this and file a bug with Inkscape and/or Cairo if it turns out to be a bug on their end. Does directly outputting the PDF from matplotlib work as a workaround? Cheers, Mike Kaushik Ghose wrote: Hi! This may be a pdf issue or an SVG issue and have nothing to do with matplotlib. If so, sorry... Whenever I produce a figure with matplotlib and 'crop it' using the axis command the svg comes out fine. However, when I save this svg to pdf using inkscape's 'cairo' backend the part of the data that was 'cropped' becomes visible in the pdf. e.g. if I had plotted data from x = -2 to +10, and then I set the axes to only show the data from +3 to +6, the svg comes out fine, but the pdf shows the rest of the graph leaking out from the axes. I currently have to manually crop my data to prevent this. Thanks! -K - 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] which basemap with matpotlib 0.91.2
Michael Hearne wrote: I'm trying to build an application on a newly installed Ubuntu. I've used apt-get to install scipy and matplotlib. numpy version: 1.0.4 scipy version: 0.6 matplotlib version: 0.91.2 What version of basemap is safe to download and build with this configuration? Doing apt-cache search basemap yields no results, so I assume there isn't an Ubuntu package for that. And if someone tells me I need to compile a newer scipy (and it's #$%^! dependencies) from source, I'll scream. Thanks, Mike Mike: Basemap's now only supported for matplotlib 0.98. For that you need numpy 1.1 (you don't need scipy at all). -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX: (303)497-6449 NOAA/OAR/PSD R/PSD1Email : [EMAIL PROTECTED] 325 BroadwayOffice : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web: http://tinyurl.com/5telg - 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] which basemap with matpotlib 0.91.2
Jeff - Well, that's the problem - I _do_ need scipy! Not for basemap, but for the rest of my application. Does your sourceforge repository have older copies of the basemap code? My complaint about scipy has to do with the fact that I spent a good week trying to get scipy's dependencies to install on two Red Hat Enterprise Linux systems: I punted both of them over to an outside contractor, who was able to compile scipy on one system, but not the other. And he specializes in that kind of stuff. --Mike Jeff Whitaker wrote: Michael Hearne wrote: I'm trying to build an application on a newly installed Ubuntu. I've used apt-get to install scipy and matplotlib. numpy version: 1.0.4 scipy version: 0.6 matplotlib version: 0.91.2 What version of basemap is safe to download and build with this configuration? Doing apt-cache search basemap yields no results, so I assume there isn't an Ubuntu package for that. And if someone tells me I need to compile a newer scipy (and it's #$%^! dependencies) from source, I'll scream. Thanks, Mike Mike: Basemap's now only supported for matplotlib 0.98. For that you need numpy 1.1 (you don't need scipy at all). -Jeff -- -- Michael Hearne [EMAIL PROTECTED] (303) 273-8620 USGS National Earthquake Information Center 1711 Illinois St. Golden CO 80401 Senior Software Engineer Synergetics, Inc. -- - 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] which basemap with matpotlib 0.91.2
Michael Hearne wrote: Jeff - Well, that's the problem - I _do_ need scipy! Not for basemap, but for the rest of my application. Does your sourceforge repository have older copies of the basemap code? Mike: OK, but I don't think upgrading numpy/maplotlib requires you to update scipy. The SF site does have older copies of basemap, but beware - I'm not backporting bugfixes. -Jeff My complaint about scipy has to do with the fact that I spent a good week trying to get scipy's dependencies to install on two Red Hat Enterprise Linux systems: I punted both of them over to an outside contractor, who was able to compile scipy on one system, but not the other. And he specializes in that kind of stuff. --Mike Jeff Whitaker wrote: Michael Hearne wrote: I'm trying to build an application on a newly installed Ubuntu. I've used apt-get to install scipy and matplotlib. numpy version: 1.0.4 scipy version: 0.6 matplotlib version: 0.91.2 What version of basemap is safe to download and build with this configuration? Doing apt-cache search basemap yields no results, so I assume there isn't an Ubuntu package for that. And if someone tells me I need to compile a newer scipy (and it's #$%^! dependencies) from source, I'll scream. Thanks, Mike Mike: Basemap's now only supported for matplotlib 0.98. For that you need numpy 1.1 (you don't need scipy at all). -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX: (303)497-6449 NOAA/OAR/PSD R/PSD1Email : [EMAIL PROTECTED] 325 BroadwayOffice : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web: http://tinyurl.com/5telg - 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] ticks labels
I am having some trouble getting the ticks and labels on my plot to match what I want and I was hoping that someone here would be able to help. Here are what I want (on the yaxis): logarithmic ticks with major ticks every order of magnitude but labels ONLY every other magnitude. Additionally, I would like the labels to be only the exponent (2 instead of 1e2 or 10^2). For the minor ticks, I want a tick at all 9 values between the major ticks. Here is what I have so far. For the minor ticks, I have subsy=[1,2,3,4,5,6,7,8,9] as an argument for semilogy which seems to work fine. To have labels every other magnitude I used ticker.LogLocator(base=100.0), which gives me the labels where I want them. The two things I have been unable to figure out are how to add a major tick at all of the other magnitudes (those without a label) and how to change the format of the labels so that only the exponent is showing. I'm sure both of these are straightforward, but I have been unable to figure them out. Thanks for your help. -Jeffrey - 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] ticks labels
On Mon, Aug 11, 2008 at 1:45 PM, Jeffrey Fogel [EMAIL PROTECTED] wrote: The two things I have been unable to figure out are how to add a major tick at all of the other magnitudes (those without a label) and how to change the format of the labels so that only the exponent is showing. I'm sure both of these are straightforward, but I have been unable to figure them out. Thanks for your help. You can accomplish both in one swoop using a custom formatter instead of a custom locator. That is, instead of using a LogLocator(base=100.0) which isn't giving you ticks where you want them, use the default log locator, and make a custom formatter to suppress strings where you don't want them and to use the format you want. Eg, something like import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as ticker fig = plt.figure() ax = fig.add_subplot(111) N = 1000 x = np.arange(N) y = np.random.rand(N)*1e8 ax.semilogy(x, y) class MyFormatter(ticker.LogFormatter): def __call__(self, val, pos=None): fx = int(np.log(abs(val))/np.log(self._base) +0.5) isDecade = self.is_decade(fx) if not isDecade and self.labelOnlyBase: return '' if (fx%2)==1: # odd, skip return '' return '%d'%fx ax.yaxis.set_major_formatter(MyFormatter()) plt.show() - 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] ticks labels
A minor comment. John's code may give incorrect results when exponents are negative. int() truncates a floating point argument towards zero, e.g., int(-1.5) == -1 not -2. I guess calling floor() before int() will work. fx = int(np.floor(np.log(abs(val))/np.log(self._base) +0.5)) -JJ On Mon, Aug 11, 2008 at 3:23 PM, John Hunter [EMAIL PROTECTED] wrote: On Mon, Aug 11, 2008 at 1:45 PM, Jeffrey Fogel [EMAIL PROTECTED] wrote: The two things I have been unable to figure out are how to add a major tick at all of the other magnitudes (those without a label) and how to change the format of the labels so that only the exponent is showing. I'm sure both of these are straightforward, but I have been unable to figure them out. Thanks for your help. You can accomplish both in one swoop using a custom formatter instead of a custom locator. That is, instead of using a LogLocator(base=100.0) which isn't giving you ticks where you want them, use the default log locator, and make a custom formatter to suppress strings where you don't want them and to use the format you want. Eg, something like import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as ticker fig = plt.figure() ax = fig.add_subplot(111) N = 1000 x = np.arange(N) y = np.random.rand(N)*1e8 ax.semilogy(x, y) class MyFormatter(ticker.LogFormatter): def __call__(self, val, pos=None): fx = int(np.log(abs(val))/np.log(self._base) +0.5) isDecade = self.is_decade(fx) if not isDecade and self.labelOnlyBase: return '' if (fx%2)==1: # odd, skip return '' return '%d'%fx ax.yaxis.set_major_formatter(MyFormatter()) plt.show() - 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] windrose OO
Lionel Roubeyrie wrote: find with this message a modified version of windrose to be OO compliant. Lionel, I've had this message of yours (from March), and finally had a chance to use it. Unfortunately, it seems to use the old Transforms mechanism, so won't work with the latest MPL. have you ported it over yet? Can anyone else help out with a port? Thanks, -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/ORR(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] windrose_oo.py Description: application/python - 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] ticks labels
Thanks John, that worked perfectly (with JJ's correction). I'm fairly new to python and hadn't considered writing a separate class for it. -Jeffrey On Mon, Aug 11, 2008 at 3:53 PM, Jae-Joon Lee [EMAIL PROTECTED] wrote: A minor comment. John's code may give incorrect results when exponents are negative. int() truncates a floating point argument towards zero, e.g., int(-1.5) == -1 not -2. I guess calling floor() before int() will work. fx = int(np.floor(np.log(abs(val))/np.log(self._base) +0.5)) -JJ On Mon, Aug 11, 2008 at 3:23 PM, John Hunter [EMAIL PROTECTED] wrote: On Mon, Aug 11, 2008 at 1:45 PM, Jeffrey Fogel [EMAIL PROTECTED] wrote: The two things I have been unable to figure out are how to add a major tick at all of the other magnitudes (those without a label) and how to change the format of the labels so that only the exponent is showing. I'm sure both of these are straightforward, but I have been unable to figure them out. Thanks for your help. You can accomplish both in one swoop using a custom formatter instead of a custom locator. That is, instead of using a LogLocator(base=100.0) which isn't giving you ticks where you want them, use the default log locator, and make a custom formatter to suppress strings where you don't want them and to use the format you want. Eg, something like import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as ticker fig = plt.figure() ax = fig.add_subplot(111) N = 1000 x = np.arange(N) y = np.random.rand(N)*1e8 ax.semilogy(x, y) class MyFormatter(ticker.LogFormatter): def __call__(self, val, pos=None): fx = int(np.log(abs(val))/np.log(self._base) +0.5) isDecade = self.is_decade(fx) if not isDecade and self.labelOnlyBase: return '' if (fx%2)==1: # odd, skip return '' return '%d'%fx ax.yaxis.set_major_formatter(MyFormatter()) plt.show() - 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] windrose OO
Christopher Barker wrote: have you ported it over yet? Can anyone else help out with a port? Note: it looks pretty easy, if yu know what you are doing: from matplotlib.transforms import Interval, Value Then in the code, I inly see Interval and Value used here: self.rintv = Interval(Value(0), Value(1)) self.rintd = Interval(Value(0), Value(1)) Is there a guide to translating code from the old to new Transforms structure? -CHB -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/ORR(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=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] windrose OO
On Mon, Aug 11, 2008 at 3:51 PM, Michael Droettboom [EMAIL PROTECTED] wrote: Christopher Barker wrote: Is there a guide to translating code from the old to new Transforms structure? Yes, in the API_CHANGES file, in the source distribution. (I'd link to SVN, but it seems Sourceforge's SVN browser is down.) We keep a copy of this file at http://matplotlib.sf.net/API_CHANGES that is updated with every release See also http://matplotlib.sourceforge.net/MIGRATION.txt 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
Re: [Matplotlib-users] windrose OO
On Mon, Aug 11, 2008 at 3:51 PM, Michael Droettboom [EMAIL PROTECTED] wrote: Christopher Barker wrote: Is there a guide to translating code from the old to new Transforms structure? Yes, in the API_CHANGES file, in the source distribution. (I'd link to SVN, but it seems Sourceforge's SVN browser is down.) We keep a copy of this file at http://matplotlib.sf.net/API_CHANGES that is updated with every release See also http://matplotlib.sourceforge.net/MIGRATION.txt 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
Re: [Matplotlib-users] Figure existence test
Bump... Does no-one have a solution for this? - I am a BugMeNot account and postings from this user may not always be from the same person. -- View this message in context: http://www.nabble.com/Figure-existence-test-tp18760841p18934165.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] Figure existence test
On Mon, Aug 11, 2008 at 4:24 PM, nobody [EMAIL PROTECTED] wrote: Bump... Does no-one have a solution for this? Sorry for not answering. There is no elegant way to do this so we should add support. In the meantime, the following hack should work figs = [manager.canvas.figure for manager in pylab._pylab_helpers.Gcf.get_all_fig_managers()] And you asked about testing to see if a figure exists -- do you mean by figure number? If so, you could check a number against the num attribute from the figure list somenum in [fig.num for fig in figs] 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
Re: [Matplotlib-users] Custom pan button
Sorry folks, I found my own problem. Looks like the axes pan functions were a recent addition to matplotlib and the version I'm using, 0.91.2, doesn't have these. Time to bug the system admin to update to the 0.98 version. -Jonathan Helmus Jonathan Helmus wrote: I have been working on a GUI application which uses matplotlib as a wx object. I'd like to include a pan button on the toolbar of the application but can't seem to get an axes object which has the pan functions (which I'd like to use to tie into the pan code). I have a self.axes object that identifies itself as matplotlib.axes.Subplot instance... which I use to add lines, set limits, etc but it doesn't have any of the pan functions (start_pan, end_pan, etc). self.canvas.figure.get_axes() (which is what seems to be used in the NavigationToolbar2 class) returns the same Subplot instance. Any suggestions of how to get a axes/Subplot instance which has the pan functions? Thanks, -Jonathan Helmus - 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] Custom pan button
On Mon, Aug 11, 2008 at 1:31 PM, Jonathan Helmus [EMAIL PROTECTED] wrote: [snip] instance... which I use to add lines, set limits, etc but it doesn't have any of the pan functions (start_pan, end_pan, etc). self.canvas.figure.get_axes() (which is what seems to be used in the NavigationToolbar2 class) returns the same Subplot instance. Any suggestions of how to get a axes/Subplot instance which has the pan functions? Hi Jonathan, On earlier versions of Matplotlib, you can use the NavigationToolbar2 class without actually displaying it (the toolbar) in your program. Instead you can use your custom buttons, keypresses, etc, to tie into the class' methods. We've done that with our app, and it works quite nicely. In fact, you can borrow the bits you need from that class to create your own zoom/pan routines. Cheers, Anthony. - 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