You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1
(1) |
2
(43) |
3
(17) |
4
(12) |
5
(9) |
6
(14) |
7
(8) |
8
|
9
(15) |
10
(16) |
11
(11) |
12
(10) |
13
(20) |
14
(7) |
15
(4) |
16
(16) |
17
(25) |
18
(10) |
19
(27) |
20
(26) |
21
(6) |
22
(20) |
23
(12) |
24
(15) |
25
(22) |
26
(15) |
27
(43) |
28
(8) |
29
(6) |
30
(12) |
|
|
|
|
|
Hi Michael, Thanks! This really does the trick. The circles look beautiful and smooth now. ;) You rock! Kelvin Quee Michael Droettboom wrote: > You can pass in a "marker" argument with a tuple of the form (numsides, > style, angle) to scatter. > > *numsides*: > the number of sides > > *style*: > the style of the regular symbol: > > ===== ================== > Value Description > ===== ================== > 0 a regular polygon > 1 a star-like symbol > 2 an asterisk > ===== ================== > > *angle*: > the angle of rotation of the symbol > > For example: > > scatter(marker=(100, 0, 0)) > > You can make "numsides" as high as you need until it's smooth enough at > the sizes you need. > > On a related note, now that matplotlib can use splines to draw circles > (in the 0.98.x series), matplotlib should probably do that for scatter > circles. This will require changing some code on our end. This will > avoid requiring the kind of workaround I suggest above. > > Cheers, > Mike > > Kelvin Quee wrote: > >> Hi folks, >> >> I'm currently trying to plot some Bubble Charts using the scatter plot >> function. >> >> It works beautifully, but the circles drawn are a little too jagged for >> my liking. >> >> I'm following the example shown here - >> >> http://matplotlib.sourceforge.net/screenshots.html >> (look for scatter plot) >> >> Even in the example picture, you can see slight jagged edges in bigger >> circles. >> >> http://matplotlib.sourceforge.net/screenshots/scatter_demo2_large.png >> >> Does anyone have a clue on how I can improve the way the bubbles are >> rendered? >> >> >> > >
This is the first bugfix release of the 0.98 series, with lots of small bugs fixed and a few features added. Thanks to Charlie Moad for the builds: src and binaries available from http://sourceforge.net/project/showfiles.php?group_id=80706. For those of you on the 0.91 maintenance branch, we have also put out a 0.91.4 bugfix release with downloads at the link above. 0.98.1 CHANGELOG: 2008年06月22日 Released 0.98.1 at revision 5637 2008年06月22日 Removed axes3d support and replaced it with a NotImplementedError for one release cycle 2008年06月21日 fix marker placement bug in backend_ps - DSD 2008年06月20日 [ 1978629 ] scale documentation missing/incorrect for log - MGD 2008年06月20日 Added closed kwarg to PolyCollection. Fixes bug [ 1994535 ] still missing lines on graph with svn (r 5548). - MGD 2008年06月20日 Added set/get_closed method to Polygon; fixes error in hist - MM 2008年06月19日 Use relative font sizes (e.g. 'medium' and 'large') in rcsetup.py and matplotlibrc.template so that text will be scaled by default when changing rcParams['font.size'] - EF 2008年06月17日 Add a generic PatchCollection class that can contain any kind of patch. - MGD 2008年06月13日 Change pie chart label alignment to avoid having labels overwrite the pie - MGD 2008年06月12日 Added some helper functions to the mathtext parser to return bitmap arrays or write pngs to make it easier to use mathtext outside the context of an mpl figure. modified the mathpng sphinxext to use the mathtext png save functionality - see examples/api/mathtext_asarray.py - JDH 2008年06月11日 Use matplotlib.mathtext to render math expressions in online docs - MGD 2008年06月11日 Move PNG loading/saving to its own extension module, and remove duplicate code in _backend_agg.cpp and _image.cpp that does the same thing - MGD 2008年06月11日 Numerous mathtext bugfixes, primarily related to dpi-independence - MGD 2008年06月10日 Bar now applies the label only to the first patch only, and sets '_nolegend_' for the other patch labels. This lets autolegend work as expected for hist and bar - see https://sourceforge.net/tracker/index.php?func=detail&aid=1986597&group_id=80706&atid=560720 JDH 2008年06月10日 Fix text baseline alignment bug. [ 1985420 ] Repair of baseline alignment in Text._get_layout. Thanks Stan West - MGD 2008年06月09日 Committed Gregor's image resample patch to downsampling images with new rcparam image.resample - JDH 2008年06月09日 Don't install Enthought.Traits along with matplotlib. For matplotlib developers convenience, it can still be installed by setting an option in setup.cfg while we figure decide if there is a future for the traited config - DSD 2008年06月09日 Added range keyword arg to hist() - MM 2008年06月07日 Moved list of backends to rcsetup.py; made use of lower case for backend names consistent; use validate_backend when importing backends subpackage - EF 2008年06月06日 hist() revision, applied ideas proposed by Erik Tollerud and Olle Engdegard: make histtype='step' unfilled by default and introduce histtype='stepfilled'; use default color cycle; introduce reverse cumulative histogram; new align keyword - MM 2008年06月06日 Fix closed polygon patch and also provide the option to not close the polygon - MGD 2008年06月05日 Fix some dpi-changing-related problems with PolyCollection, as called by Axes.scatter() - MGD 2008年06月05日 Fix image drawing so there is no extra space to the right or bottom - MGD 2006年06月04日 Added a figure title command subtitle as a Figure method and pyplot command -- see examples/figure_title.py - JDH 2008年06月02日 Added support for log to hist with histtype='step' and fixed a bug for log-scale stacked histograms - MM 0.91.4 CHANGELOG =================== 2008年06月22日 Released 0.91.4 at revision 5638 2008年06月09日 Don't install Enthought.Traits along with matplotlib. For matplotlib developers convenience, it can still be installed by setting an option in setup.cfg while we figure decide if there is a future for the traited config - DSD 2008年06月02日 Fix crash in Agg when drawing collections with no fill and/or edge color - MGD
1. "requires python2.4" seems to imply that python 2.5 won't work. 2. "produces publication quality figures" should be "produces publication-quality figures". Keith
You can pass in a "marker" argument with a tuple of the form (numsides, style, angle) to scatter. *numsides*: the number of sides *style*: the style of the regular symbol: ===== ================== Value Description ===== ================== 0 a regular polygon 1 a star-like symbol 2 an asterisk ===== ================== *angle*: the angle of rotation of the symbol For example: scatter(marker=(100, 0, 0)) You can make "numsides" as high as you need until it's smooth enough at the sizes you need. On a related note, now that matplotlib can use splines to draw circles (in the 0.98.x series), matplotlib should probably do that for scatter circles. This will require changing some code on our end. This will avoid requiring the kind of workaround I suggest above. Cheers, Mike Kelvin Quee wrote: > Hi folks, > > I'm currently trying to plot some Bubble Charts using the scatter plot > function. > > It works beautifully, but the circles drawn are a little too jagged for > my liking. > > I'm following the example shown here - > > http://matplotlib.sourceforge.net/screenshots.html > (look for scatter plot) > > Even in the example picture, you can see slight jagged edges in bigger > circles. > > http://matplotlib.sourceforge.net/screenshots/scatter_demo2_large.png > > Does anyone have a clue on how I can improve the way the bubbles are > rendered? > > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
On Sunday 22 June 2008 21:49:03 Erik Tollerud wrote: > I'm trying to adjust the font weight on some of my plots - I'd like to > have the numbers along the axis ticks be bold instead of regular font > like the default setting. The problem is, nothing I do seems to > change the font weight. I've changed everything I can font in > matplotlibrc to bold, and when I go in and explicitly look at the > XTick or YTick objects and their text properties, it even claims the > text is bold... yet the text is normal weight font when displayed on > the plot. > > A would also like to have the plot labels be bolder, as well, and I > can't seem to change that either. > > Note that I have usetex as True, and I realize that this means the > labels, at least, are rendered through TeX... but I'm not clear on how > I can change the font properties to render bold versions of all the > TeX fonts I'm using (assuming this is possible). There is currently no support for bold ticklabels with usetex. > And I've been under > the impression that the default number formattes, at least, don't > render through TeX. I don't understand, what default number formats? When you enable usetex, tex is used to render all text. > So does anyone know how I can make all/any of my > text elemens bold? The tex option was not designed to provide all the flexibility of matplotlib's text handling. It was pretty hairy trying to support as many font properties as we currently support. Darren
I'm trying to adjust the font weight on some of my plots - I'd like to have the numbers along the axis ticks be bold instead of regular font like the default setting. The problem is, nothing I do seems to change the font weight. I've changed everything I can font in matplotlibrc to bold, and when I go in and explicitly look at the XTick or YTick objects and their text properties, it even claims the text is bold... yet the text is normal weight font when displayed on the plot. A would also like to have the plot labels be bolder, as well, and I can't seem to change that either. Note that I have usetex as True, and I realize that this means the labels, at least, are rendered through TeX... but I'm not clear on how I can change the font properties to render bold versions of all the TeX fonts I'm using (assuming this is possible). And I've been under the impression that the default number formattes, at least, don't render through TeX. So does anyone know how I can make all/any of my text elemens bold?
My guess is that clicking on a collection causes a pick event to be returned by the collection itself and also perhaps by the barh member in the collection. No idea if that's the case, but just for the record, I figured out a simple enough workaround in which the pick handler is disconnected to open a wxPython popup window. Once that window is closed, the pick handler is reconnected: self.evt_bind = self.canvas.mpl_connect('pick_event', self.on_pick) . . . . def on_pick(self, event): if type(event.artist) == brokenbarh: self.canvas.mpl_disconnect(self.evt_bind) popup = popupwin(self, event.mouseevent.xdata, event.mouseevent.ydata) popup.Popup() class popupwin(wx.PopupTransientWindow): def __init__(self, plot, x_coord, y_coord): wx.PopupTransientWindow.__init__(self, plot) self.plot = plot text = st.gen(self, 'hello') def OnDismiss(self): self.plot.evt_bind = self.plot.canvas.mpl_connect('pick_event', self.plot.on_pick On Sun, Jun 22, 2008 at 1:18 AM, Paul Hartley <pha...@gm...> wrote: > > If I click on a bar that is part of a broken_barh collection which has its > picker attribute enabled, there appears to be two events generated for > example: > > def on_pick(self, event): > print event.mouseevent.xdata > print event.mouseevent.ydata > > clicking on a bar will cause this method to be executed twice, hence I get > something like this if I click just once: > > 5575.97222222 > 0.0277777777778 > 5575.97222222 > 0.0277777777778 > > Is there a workaround such that the method is executed only once? >
Matt C wrote: > I'm very new to MPL, and I'm having a blast with it - great work. I've > looked around the docs, lists and other random places for a hint on > this, but I'm still stumped. > > The goal is simple: I'd like to create a very basic animated bar or barh > chart. I've been playing via ion() from the IPython shell but I run into > the following issue: The bar is painted correctly, but any value lower > than the max doesn't show up, as the max value bar doesn't clear. For > example, from IPython: > > bar(10+0.25, 10) shows perfectly, then an update (using interactive mode > set to on) > bar(10+0.25, 4) Try adding a clf(), which clears the current figure, in between the calls to bar. Another option is to use hold(False) signals that you want a new plotting command to start from a clean slate. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma
I'm very new to MPL, and I'm having a blast with it - great work. I've looked around the docs, lists and other random places for a hint on this, but I'm still stumped. The goal is simple: I'd like to create a very basic animated bar or barh chart. I've been playing via ion() from the IPython shell but I run into the following issue: The bar is painted correctly, but any value lower than the max doesn't show up, as the max value bar doesn't clear. For example, from IPython: bar(10+0.25, 10) shows perfectly, then an update (using interactive mode set to on) bar(10+0.25, 4) ...shows a new bar with a y value of 4, but the old bar (value 10) is still painted. As a result, it doesn't look quite right. Is there an easy way to clear the old max value bar? Thanks for any advice. Regards, Matt
Thanks Eric. Yeah, I noticed the _lut attribute and conjectured that it was the most analogous structure. Can you please tell me more about it, e.g., why N+3? Is the fourth column an alpha spec? If so, would this be a way to give different colors different alpha values (which is something I want to be able to do; actually, what I want to do is to be able to specify a non-constant array of alpha values, i.e., I want direct pixel-to-pixel control over alpha values...) Anyway, I'll build some tools around it and submit as a "patch" for possible inclusion in future releases... DG --- On Sun, 6/22/08, Eric Firing <ef...@ha...> wrote: > From: Eric Firing <ef...@ha...> > Subject: Re: [Matplotlib-users] More Matlab-like way to manipulate colormaps? > To: d_l...@ya... > Cc: mat...@li... > Date: Sunday, June 22, 2008, 1:14 AM > David, > > There is no such API--maybe we should add some methods to > the base > Colormap so there would be--but you can do it yourself in > either of two > ways. > > First, you can generate a colormap from a list of colors, > and the colors > can be rgb triplets, so you could make your Nx3 array, do > whatever you > want with it, and then turn it into a colormap by using it > to initialize > a ListedColormap. (The ListedColormap accepts an Nx3 > array, or a list > of any valid mpl colorspecs.) > > Second, if you have any existing mpl Colormap instance, you > can directly > manipulate the _lut attribute; it is an ndarray and its > dimensions are > (N+3)x4. You might want to manipulate only the [:N,:3] > subarray of it. > The leading underscore means this attribute is not > intended for user > manipulation--but there is nothing to stop you from doing > it in a pinch > if necessary. > > Eric > > David Goldsmith wrote: > > Hi. Making progress. Caveat for what follows: the > last version of Matlab I used was like 6 or 7, I think - > it's been a little while - so for all I know, the > colormap manipulation API I've been able to discover in > the current MPL does correspond closely to the same thing in > the current Matlab. That said, said MPL colormap API is > much more "powerful" (and consequently > complicated) than I need, at least for right now. :-) Is > there a set of tools I'm not finding, or perhaps a > third-party add-on, that enables more Matlab-like colormap > manipulation? For example, I'm use to a (Matlab) > colormap simply being an Nx3 array of N RGB triples (or at > least that's the API), which one can then process using > standard array operators (+, *, etc.), methods (transpose, > flipud, fliplr, etc), etc. and create and apply new > colormaps by simply saying "colormap = <new N x 3 > array>" - are there tools which enable this manner > of manipulating MPL's colormap class instances? Or > > a "built-in" API to these that I'm not > finding? Thanks! > > > > DG > > > > PS: In case this is relevant, I'm using the OO > API, not pylab. Thanks again. > > > > > > > > > > > > > ------------------------------------------------------------------------- > > Check out the new SourceForge.net Marketplace. > > It's the best place to buy or sell services for > > just about anything Open Source. > > http://sourceforge.net/services/buy/index.php > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
On Fri, Jun 20, 2008 at 12:12 PM, Eric Firing <ef...@ha...> wrote: >> transformation refactoring to have that working. Personally, I'm +1 on >> removing axes3d.py to avoid confusion. Done home:~/mpl/lib/matplotlib> cat axes3d.py raise NotImplmentedError('axes3d is not supported in matplotlib-0.98. You may want to try the 0.91.x maintenance branch')
John Hunter-4 wrote: > >> I think that for interactive work such as you describe, ipython -pylab >> pretty well solves the problem, and provides window behavior like >> matlab's. > Yes, exactly. Those of you trying to make this work may want to read > http://matplotlib.sf.net/interactive.html . > Yes, iPython takes care of these issues in interactive use. I've been trying to stay on mainline Python for portable application development and was using the interactive Matlab scenario as an example of "expected" non-blocking behavior. Interactive use isn't the end-goal for me, or, I think, for Dan. The root issue is the need to keep other activities running while a plot window is open, which comes back to the blocking behavior of show(). It looks like the code linked in the previous post does the job; it just requires getting under the hood of GTK a bit more to use a separate manager function for each plot window. That's fine, and actually it seems it would be preferable as the default behavior of matplotlib (though each backend probaby requires unique code). There are other alternatives: plot to a file and display the image in a window, which loses the zoom/pan functions in matplotlib windows, or launch the matplotlib plot window as a separate process or program. Thanks, Scott -- View this message in context: http://www.nabble.com/threading-problems-tp18015447p18055354.html Sent from the matplotlib - users mailing list archive at Nabble.com.
On Sun, Jun 22, 2008 at 12:31 AM, Eric Firing <ef...@ha...> wrote: > Scott, > > I think that for interactive work such as you describe, ipython -pylab > pretty well solves the problem, and provides window behavior like matlab's. Yes, exactly. Those of you trying to make this work may want to read http://matplotlib.sf.net/interactive.html .
Hi folks, I'm currently trying to plot some Bubble Charts using the scatter plot function. It works beautifully, but the circles drawn are a little too jagged for my liking. I'm following the example shown here - http://matplotlib.sourceforge.net/screenshots.html (look for scatter plot) Even in the example picture, you can see slight jagged edges in bigger circles. http://matplotlib.sourceforge.net/screenshots/scatter_demo2_large.png Does anyone have a clue on how I can improve the way the bubbles are rendered? -- Kelvin Quee +65 9177 3635 kq...@kq... Bridging People with Ideas http://InteresThink.com
Michael Droettboom wrote: > I'm not very familiar with how axes3d works, but just by looking at the > number of transform calls and objects, it appears that it will take > significant effort to update it. It was never one of the goals of the > transformation refactoring to have that working. Personally, I'm +1 on > removing axes3d.py to avoid confusion. I agree. This is overdue. Eric
If I click on a bar that is part of a broken_barh collection which has its picker attribute enabled, there appears to be two events generated for example: def on_pick(self, event): print event.mouseevent.xdata print event.mouseevent.ydata clicking on a bar will cause this method to be executed twice, hence I get something like this if I click just once: 5575.97222222 0.0277777777778 5575.97222222 0.0277777777778 Is there a workaround such that the method is executed only once?
David, There is no such API--maybe we should add some methods to the base Colormap so there would be--but you can do it yourself in either of two ways. First, you can generate a colormap from a list of colors, and the colors can be rgb triplets, so you could make your Nx3 array, do whatever you want with it, and then turn it into a colormap by using it to initialize a ListedColormap. (The ListedColormap accepts an Nx3 array, or a list of any valid mpl colorspecs.) Second, if you have any existing mpl Colormap instance, you can directly manipulate the _lut attribute; it is an ndarray and its dimensions are (N+3)x4. You might want to manipulate only the [:N,:3] subarray of it. The leading underscore means this attribute is not intended for user manipulation--but there is nothing to stop you from doing it in a pinch if necessary. Eric David Goldsmith wrote: > Hi. Making progress. Caveat for what follows: the last version of Matlab I used was like 6 or 7, I think - it's been a little while - so for all I know, the colormap manipulation API I've been able to discover in the current MPL does correspond closely to the same thing in the current Matlab. That said, said MPL colormap API is much more "powerful" (and consequently complicated) than I need, at least for right now. :-) Is there a set of tools I'm not finding, or perhaps a third-party add-on, that enables more Matlab-like colormap manipulation? For example, I'm use to a (Matlab) colormap simply being an Nx3 array of N RGB triples (or at least that's the API), which one can then process using standard array operators (+, *, etc.), methods (transpose, flipud, fliplr, etc), etc. and create and apply new colormaps by simply saying "colormap = <new N x 3 array>" - are there tools which enable this manner of manipulating MPL's colormap class instances? Or > a "built-in" API to these that I'm not finding? Thanks! > > DG > > PS: In case this is relevant, I'm using the OO API, not pylab. Thanks again. > > > > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Hi. Making progress. Caveat for what follows: the last version of Matlab I used was like 6 or 7, I think - it's been a little while - so for all I know, the colormap manipulation API I've been able to discover in the current MPL does correspond closely to the same thing in the current Matlab. That said, said MPL colormap API is much more "powerful" (and consequently complicated) than I need, at least for right now. :-) Is there a set of tools I'm not finding, or perhaps a third-party add-on, that enables more Matlab-like colormap manipulation? For example, I'm use to a (Matlab) colormap simply being an Nx3 array of N RGB triples (or at least that's the API), which one can then process using standard array operators (+, *, etc.), methods (transpose, flipud, fliplr, etc), etc. and create and apply new colormaps by simply saying "colormap = <new N x 3 array>" - are there tools which enable this manner of manipulating MPL's colormap class instances? Or a "built-in" API to these that I'm not finding? Thanks! DG PS: In case this is relevant, I'm using the OO API, not pylab. Thanks again.
Mike, just a question about the new transforms backend -- can the input dimensionality be greater than 2? (I realize functions to do so probably don't currently exist, but the question is about the transforms machinery itself.) -Andrew Michael Droettboom wrote: > I'm not very familiar with how axes3d works, but just by looking at the > number of transform calls and objects, it appears that it will take > significant effort to update it. It was never one of the goals of the > transformation refactoring to have that working. Personally, I'm +1 on > removing axes3d.py to avoid confusion. > > However, a motivated user could follow the information in API_CHANGES to > update axes3d.py. I'd be happy to help if you got stuck, but I don't > really have the motivation/mandate to do the whole thing myself. > > Cheers, > Mike > > Matthias Michler wrote: > >> Hello list, >> >> I know it is not recommended to use matplotlib for 3d plotting, but for a >> while simple plots worked fine for me. This is not the case with actual svn >> version and therefore my question is: Would it break at lost or cost much >> effort to make the 3d-plot-examples of the Cookbook work? >> >> if I try: >> [1] import matplotlib.axes3d as p3 >> I get the error attached below. >> >> Thanks for any advise in advance. >> >> best regards Matthias >> >> --------------------------------------------------------------------------- >> <type 'exceptions.ImportError'> Traceback (most recent call last) >> >> /home/michler/CompPhys_2008/Uebungsaufgaben/050_Antidot/3D_matplotlib/<ipython >> console> in <module>() >> >> /scratch/michler/SOFT/lib/python2.5/site-packages/matplotlib/axes3d.py in >> <module>() >> 14 from axes import Axes >> 15 import cbook >> ---> 16 from transforms import unit_bbox >> 17 >> 18 import numpy as np >> >> <type 'exceptions.ImportError'>: cannot import name unit_bbox >> >> >>> /scratch/michler/SOFT/lib/python2.5/site-packages/matplotlib/axes3d.py(16)<module>() >>> >>> >> 15 import cbook >> ---> 16 from transforms import unit_bbox >> 17 >> >> ------------------------------------------------------------------------- >> Check out the new SourceForge.net Marketplace. >> It's the best place to buy or sell services for >> just about anything Open Source. >> http://sourceforge.net/services/buy/index.php >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > >
Chris, The point is that contouring and gridding are two entirely separate operations--and this is true in general, not just for matplotlib. Contouring algorithms--at least all the ones I have looked at--work with data on a regular grid. There are many ways to map scattered data to a regular grid, so it makes sense to do this as a separate step, so you can choose a gridding method that works well for your particular type of data set. See http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data Now, if your data are already on a quadrilateral grid, as in the example you give, but your arrays have been flattened, then all you need to do is reshape your arrays so that they are 2-D, with the row number corresponding to Y (vertical on the plot) and the column index corresponding to X (horizontal). Filling in your example below to include 2 values of x, and assuming all three variables are numpy ndarrays, you could do something like this: x.shape = 2,3 y.shape = 2,3 z.shape = 2,3 contour(x.transpose(), y.transpose(), z.transpose()) The transposes are needed because your original z is arranged with y varying fastest. Eric Chris wrote: > I may be a bit thick, but I am having a heck of a time figuring out how to > use contour() properly. > Specifically, I do not see why the z dimension should be a 2d array. > It should only take a set of x,y,z > coordinates to produce a surface -- what is the extra dimension for? More > importantly, how do I take > "canonical" 3-d data, e.g.: > > x y z > 1 1 2.3 > 1 2 4.5 > 1 3 6.1 > 2 1 7.3 > . > . > . > > > and get it into the form that matplotlib demands? > > Thanks, > cf > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
On Friday 20 June 2008 5:40:04 pm Bryan Fodness wrote: > Is there a way to get the colorbar to work with an axes instance. > > ax2 = axes([0.2, 0.1, 0.6, 0.8], axisbg='w') > ax2.fill([x1,x2,x2,x1], [y1,y1,y2,y2], fc='None', ec='r') > ax2.pcolormesh(X, Y, newa, shading='flat', cmap=cm.YlOrRd)#gray_r) > ax2.axvline(x=0, color='gray', linestyle='--') > ax2.axhline(y=0, color='gray', linestyle='--') > ax2.plot([offaxisX], [offaxisY], 'r+', mew=1) > ax2.colorbar() > > AttributeError: 'Axes' object has no attribute 'colorbar' I think you are looking for the Figure.colorbar() method if you are using the OO API. If you are using the pylab interface, it is pylab.colorbar: > colorbar() > > , line 499, in <module> > colorbar() > File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 1129, in > colorbar > ret = gcf().colorbar(mappable, cax = cax, ax=ax, **kw) > File "C:\Python25\Lib\site-packages\matplotlib\figure.py", line 956, in > colorbar > cb = cbar.Colorbar(cax, mappable, **kw) > File "C:\Python25\Lib\site-packages\matplotlib\colorbar.py", line 558, in > __init__ > mappable.autoscale_None() # Ensure mappable.norm.vmin, vmax > AttributeError: 'NoneType' object has no attribute 'autoscale_None' > > I am not sure how the mappable, ax, and cax options work. Try: ax2 = axes([0.2, 0.1, 0.6, 0.8], axisbg='w') ax2.fill([x1,x2,x2,x1], [y1,y1,y2,y2], fc='None', ec='r') ax2.pcolormesh(X, Y, newa, shading='flat', cmap=cm.YlOrRd)#gray_r) colorbar() ax2.axvline(x=0, color='gray', linestyle='--') ax2.axhline(y=0, color='gray', linestyle='--') ax2.plot([offaxisX], [offaxisY], 'r+', mew=1) or: ax2 = axes([0.2, 0.1, 0.6, 0.8], axisbg='w') ax2.fill([x1,x2,x2,x1], [y1,y1,y2,y2], fc='None', ec='r') mappable = ax2.pcolormesh(X, Y, newa, shading='flat', cmap=cm.YlOrRd)#gray_r) ax2.axvline(x=0, color='gray', linestyle='--') ax2.axhline(y=0, color='gray', linestyle='--') ax2.plot([offaxisX], [offaxisY], 'r+', mew=1) colorbar(mappable, ax=ax2) or: ax2 = axes([0.2, 0.1, 0.6, 0.8], axisbg='w') ax2.fill([x1,x2,x2,x1], [y1,y1,y2,y2], fc='None', ec='r') mappable = ax2.pcolormesh(X, Y, newa, shading='flat', cmap=cm.YlOrRd)#gray_r) ax2.axvline(x=0, color='gray', linestyle='--') ax2.axhline(y=0, color='gray', linestyle='--') ax2.plot([offaxisX], [offaxisY], 'r+', mew=1) cax = axes([0.65, 0.1, 0.2, 0.8], axisbg='w') colorbar(mappable, cax=cax)
Scott, I think that for interactive work such as you describe, ipython -pylab pretty well solves the problem, and provides window behavior like matlab's. Ipython is a big help when working with python even when you are not plotting. It is easy to install, and you don't have to learn much to start using it to good advantage. See http://ipython.scipy.org/moin/ Eric SRH wrote: > > Daniel Ashbrook wrote: >> The issue is that the >> show() command takes over the main thread of execution, so I can't have >> my listening process running. Essentially I need to: >> >> 1) Pop up a figure() >> 2) Start the drawing loop >> 3) Start the socket listener >> 4) When the listener gets commands, execute them (plot, etc) >> >> Is this something that I can do? >> Thanks, >> dan >> > > > I've been running into _exactly_ this issue for the past few weeks trying to > get matplotlib windows to behave a bit more like Matlab plots (or other > tools). I'm pretty new to Python and threaded GUIs (trying to come up to > speed)... maybe it's obvious to others more experienced about how to do > these things, but hard for us to explain the problem. I'll try to explain > the desired/expected behavior from a Matlab user point of view: > > When using Matlab, one often creates plots in interactive (command line) > operations, or when calling scripts (m-files). But multiple plot windows > can be left open/running, and all other operations can proceed as normally - > that is, there is no blocking, and the windows behave as independent > entities - always active and not affecting behavior of other windows at all. > For example, one can run a script that creates a few plots, edit the script, > run it again, and have both the original plot windows and the new ones up at > the same time for comparision. It's the blocking behavior of show() that is > most perplexing. (While GTK may be threaded, matplotlib's show() doesn't > behave that way...) > > There's a post on osdir.com from 2004 where John posted example code of how > to use the underlying GTK functions for a show() that's unique to each > window's thread, rather than the the matplotlib show() which appears to take > over (block) the entire Python process until the window is closed: > > http://osdir.com/ml/python.matplotlib.general/2004-07/msg00070.html > > I've seen this question come up in several posts without adequate answers, > until I came across that one. It would be great if we (or someone) can > write up a summary of this and get it into the Matplotlib docs. (Point me > in the right direction and I'll make an attempt.) > > (Nice plotting tool, by the way, John et al. Good work.) > Thanks, > Scott
Bryan Fodness wrote: > Is there a way to get the colorbar to work with an axes instance. > > ax2 = axes([0.2, 0.1, 0.6, 0.8], axisbg='w') > ax2.fill([x1,x2,x2,x1], [y1,y1,y2,y2], fc='None', ec='r') > ax2.pcolormesh(X, Y, newa, shading='flat', cmap=cm.YlOrRd)#gray_r) > ax2.axvline(x=0, color='gray', linestyle='--') > ax2.axhline(y=0, color='gray', linestyle='--') > ax2.plot([offaxisX], [offaxisY], 'r+', mew=1) > ax2.colorbar() > > AttributeError: 'Axes' object has no attribute 'colorbar' Bryan, A colorbar is a plot in its own axes, so just as a figure has an "add_subplot" method to add a general-purpose axes, it has a "colorbar" method to add a special-purpose axes with a colorbar in it. One way to modify your example is something like this (untested): ax2 = axes([0.2, 0.1, 0.6, 0.8], axisbg='w') ax2.fill([x1,x2,x2,x1], [y1,y1,y2,y2], fc='None', ec='r') # Save the "mappable" returned by pcolormesh: pcm = ax2.pcolormesh(X, Y, newa, shading='flat', cmap=cm.YlOrRd)#gray_r) ax2.axvline(x=0, color='gray', linestyle='--') ax2.axhline(y=0, color='gray', linestyle='--') ax2.plot([offaxisX], [offaxisY], 'r+', mew=1) # Call the figure method, give it the mappable: ax2.get_figure().colorbar(pcm, ax=ax2) This will steal space from ax2 to make the colorbar axes. If you want to make the colorbar axes yourself, called ax_cbar, for example, then the last line would be ax2.get_figure().colorbar(pcm, cax=ax_cbar) Of course, if you make the figure at the start, and save the reference to it, then you can use that reference in place of "ax2.get_figure()" Eric > > colorbar() > > , line 499, in <module> > colorbar() > File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 1129, > in colorbar > ret = gcf().colorbar(mappable, cax = cax, ax=ax, **kw) > File "C:\Python25\Lib\site-packages\matplotlib\figure.py", line 956, > in colorbar > cb = cbar.Colorbar(cax, mappable, **kw) > File "C:\Python25\Lib\site-packages\matplotlib\colorbar.py", line 558, > in __init__ > mappable.autoscale_None() # Ensure mappable.norm.vmin, vmax > AttributeError: 'NoneType' object has no attribute 'autoscale_None' > > I am not sure how the mappable, ax, and cax options work.
Bryan Fodness wrote: > Is there a way to get the colorbar to work with an axes instance. > > ax2 = axes([0.2, 0.1, 0.6, 0.8], axisbg='w') > ax2.fill([x1,x2,x2,x1], [y1,y1,y2,y2], fc='None', ec='r') > ax2.pcolormesh(X, Y, newa, shading='flat', cmap=cm.YlOrRd)#gray_r) > ax2.axvline(x=0, color='gray', linestyle='--') > ax2.axhline(y=0, color='gray', linestyle='--') > ax2.plot([offaxisX], [offaxisY], 'r+', mew=1) > ax2.colorbar() > > AttributeError: 'Axes' object has no attribute 'colorbar' > > colorbar() > > , line 499, in <module> > colorbar() > File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 1129, > in colorbar > ret = gcf().colorbar(mappable, cax = cax, ax=ax, **kw) > File "C:\Python25\Lib\site-packages\matplotlib\figure.py", line 956, > in colorbar > cb = cbar.Colorbar(cax, mappable, **kw) > File "C:\Python25\Lib\site-packages\matplotlib\colorbar.py", line 558, > in __init__ > mappable.autoscale_None() # Ensure mappable.norm.vmin, vmax > AttributeError: 'NoneType' object has no attribute 'autoscale_None' > > I am not sure how the mappable, ax, and cax options work. You want pylab.colorbar() or figure.colorbar(). (The pylab version is just a simple wrapper around figure.colorbar()) In this case, I think you want to use the ax keyword for colorbar, as in: pylab.colorbar(ax=ax2) The ax keyword argument specifies an the axes for which you want the colorbar drawn. The cax keyword argument specifies the axes in which you want the colorbar drawn. If you don't specifiy cax, space will be taken from the ax keyword argument (or the current axes). Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma
I may be a bit thick, but I am having a heck of a time figuring out how to use contour() properly. Specifically, I do not see why the z dimension should be a 2d array. It should only take a set of x,y,z coordinates to produce a surface -- what is the extra dimension for? More importantly, how do I take "canonical" 3-d data, e.g.: x y z 1 1 2.3 1 2 4.5 1 3 6.1 2 1 7.3 . . . and get it into the form that matplotlib demands? Thanks, cf