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
(7) |
2
(3) |
3
(2) |
4
(2) |
5
(2) |
6
(3) |
7
(1) |
8
(9) |
9
(1) |
10
(9) |
11
(2) |
12
|
13
(1) |
14
(11) |
15
(8) |
16
(7) |
17
(10) |
18
(2) |
19
(3) |
20
(9) |
21
(3) |
22
(3) |
23
(1) |
24
(12) |
25
(1) |
26
(3) |
27
(3) |
28
(6) |
29
(1) |
30
(6) |
31
(1) |
|
From: David H. <dh...@gm...> - 2014-10-15 18:09:35
|
For the first question, if I save the figure (as a PNG I'm guessing, unless you can save into a more array-like format), I'd have to make sure that there were no labels or ticks and that the axes fit the whole figure. I'd also have to get the dpi and size information correct, but I suppose it would be possible that way. I was hoping for something a little easier and in-memory. This might be the simplest answer the more I think about it. If I'm starting from the paths, I'd still have to write them to the "grid" array. I thought maybe the backend could do that and I magically get the image. I'll look in to using savefig and getting the data out. -Dave On 10/15/14, 12:42 PM, Joy merwin monteiro wrote: > pardon the query if it seems dumb, but why don't you do a savefig() > after plotting the data and then convert it to any format you like? > > alternatively, contour() and contourf() both create paths that can > be accessed: > > cf = contourf(.....) > > output = cf.collections.pop() > paths = output.get_paths()[i] # for the various contours > > the x,y coordinates can then be accessed as > > xcoords = paths.vertices.transpose()[0] > ycoords = paths.vertices.transpose()[1] > > you can then do whatever you wish with them. > > Joy > > > On Wed, Oct 15, 2014 at 9:11 PM, David Hoese <dh...@gm... > <mailto:dh...@gm...>> wrote: > > I've been searching and reading through source code and google searches > to see if this is possible, but no luck so far. I'm basically trying to > map some data using Basemap, use contourf to map it to an image, and > then put that image in a geotiff (or other format) for use in other GIS > programs. I have other tools for remapping data and creating geotiffs, > but the contour image looks better. All I would need to get this to work > would be an array representing the image inside the axes of a contourf > plot. I found a lot of geotiff -> Basemap png results, but I would like > the reverse. > > Since the plots are made using paths/patches I'm guessing I would have > to have a backend render the image and then extract the image somehow. > Does anyone have some tips or tricks to do something like this? Or am I > thinking about this completely wrong? > > Thanks for any help and if you could CC me in any replies it would be > much appreciated. > > -Dave > > ------------------------------------------------------------------------------ > Comprehensive Server Monitoring with Site24x7. > Monitor 10 servers for $9/Month. > Get alerted through email, SMS, voice calls or mobile push > notifications. > Take corrective actions from your mobile device. > http://p.sf.net/sfu/Zoho > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > <mailto:Mat...@li...> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > -- > The best ruler, when he finishes his > tasks and completes his affairs, > the people say > “It all happened naturally” > > - Te Tao Ch'ing |
From: Joy m. m. <joy...@gm...> - 2014-10-15 17:42:16
|
pardon the query if it seems dumb, but why don't you do a savefig() after plotting the data and then convert it to any format you like? alternatively, contour() and contourf() both create paths that can be accessed: cf = contourf(.....) output = cf.collections.pop() paths = output.get_paths()[i] # for the various contours the x,y coordinates can then be accessed as xcoords = paths.vertices.transpose()[0] ycoords = paths.vertices.transpose()[1] you can then do whatever you wish with them. Joy On Wed, Oct 15, 2014 at 9:11 PM, David Hoese <dh...@gm...> wrote: > I've been searching and reading through source code and google searches > to see if this is possible, but no luck so far. I'm basically trying to > map some data using Basemap, use contourf to map it to an image, and > then put that image in a geotiff (or other format) for use in other GIS > programs. I have other tools for remapping data and creating geotiffs, > but the contour image looks better. All I would need to get this to work > would be an array representing the image inside the axes of a contourf > plot. I found a lot of geotiff -> Basemap png results, but I would like > the reverse. > > Since the plots are made using paths/patches I'm guessing I would have > to have a backend render the image and then extract the image somehow. > Does anyone have some tips or tricks to do something like this? Or am I > thinking about this completely wrong? > > Thanks for any help and if you could CC me in any replies it would be > much appreciated. > > -Dave > > > ------------------------------------------------------------------------------ > Comprehensive Server Monitoring with Site24x7. > Monitor 10 servers for $9/Month. > Get alerted through email, SMS, voice calls or mobile push notifications. > Take corrective actions from your mobile device. > http://p.sf.net/sfu/Zoho > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- The best ruler, when he finishes his tasks and completes his affairs, the people say “It all happened naturally” - Te Tao Ch'ing |
From: David H. <dh...@gm...> - 2014-10-15 15:41:34
|
I've been searching and reading through source code and google searches to see if this is possible, but no luck so far. I'm basically trying to map some data using Basemap, use contourf to map it to an image, and then put that image in a geotiff (or other format) for use in other GIS programs. I have other tools for remapping data and creating geotiffs, but the contour image looks better. All I would need to get this to work would be an array representing the image inside the axes of a contourf plot. I found a lot of geotiff -> Basemap png results, but I would like the reverse. Since the plots are made using paths/patches I'm guessing I would have to have a backend render the image and then extract the image somehow. Does anyone have some tips or tricks to do something like this? Or am I thinking about this completely wrong? Thanks for any help and if you could CC me in any replies it would be much appreciated. -Dave |
From: mrvelle <mr...@gm...> - 2014-10-15 08:34:13
|
On this documentation page: http://matplotlib.org/api/figure_api.html. It says: The following classes are definedSubplotParams control the default spacing of the subplots Figure top level container for all plot elements But actually there are three. The third one is: AxesStack. Or did I misunderstand smth? -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Docs-mention-two-classes-but-actually-has-three-tp44115.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Benjamin R. <ben...@ou...> - 2014-10-14 19:53:41
|
So, you need to know what tools to use to read in grib2 data? There are two particular grib readers that I am familiar with: PyNIO and pygrib2. PyNIO actually isn't a grib reader, as much as a swiss army knife of file readers. It is very similar to the netcdf4 interface, so if you are familiar with that, then PyNIO is very nice in that respect. Unfortunately, PyNIO is not available through pypi. You have to go directly to their website, sign up and download it directly from them. Oh, and may god have mercy on your soul if you have to build from source for either PyNIO or pygrib2... try the binaries if possible. Ben Root On Tue, Oct 14, 2014 at 1:09 AM, Sourav Chatterjee <sr...@gm...> wrote: > Can somebody help me to plot the wind vectors in spstere projection > reading data from a grb2 file *without using Dataset (netcdf4*)? > > Thanks > Sourav > > > ------------------------------------------------------------------------------ > Comprehensive Server Monitoring with Site24x7. > Monitor 10 servers for $9/Month. > Get alerted through email, SMS, voice calls or mobile push notifications. > Take corrective actions from your mobile device. > http://p.sf.net/sfu/Zoho > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: Slavin, J. <js...@cf...> - 2014-10-14 16:48:39
|
Hi Chris, Thanks for that tip. I'll give it a try. They are big images (2048 x 2048) so it seems like your suggestion should work. Jon On Tue, Oct 14, 2014 at 12:18 PM, Chris Beaumont <cbe...@cf...> wrote: > I've found that, for big images, the *first* draw is very slow, due to the > intensity scaling of the image, which happens at full resolution. Panning > and zooming afterwards is fast because the intensity scaling is cached, but > changing the data array or updating the norm kwarg is slow again. I made > ModestImage (https://github.com/ChrisBeaumont/mpl-modest-image) to deal > with this -- it dynamically downsamples images to screen resolution. This > makes the first draw after updating the data or norm much faster, while > slowing down subsequent redraws. Perhaps this could help you out? > > cheers, > chris > > On Tue, Oct 14, 2014 at 12:08 PM, Benjamin Root <ben...@ou...> wrote: > >> Only if there are multiple figures (plt.draw() operates on the current >> active figure, while fig.draw() explicitly operates upon that figure). >> Another possibility is that the bottleneck truly is the IO. Depending on >> exactly how fits work, it might be lazily loading data for you, so the test >> without the display of the images might not actually be loading any data >> into memory. >> >> Ben Root >> >> On Tue, Oct 14, 2014 at 11:22 AM, Slavin, Jonathan < >> js...@cf...> wrote: >> >>> Hmm. I just saw that you suggest fig.draw(). Is there a difference >>> with plt.draw()? >>> >>> Jon >>> >>> On Tue, Oct 14, 2014 at 11:20 AM, Slavin, Jonathan < >>> js...@cf...> wrote: >>> >>>> Hi Ben, >>>> >>>> Sorry, in my little example, I left out a few things. I do update >>>> first after the first call. And I do call draw() after other calls. So >>>> here is a more accurate representation of what I do: >>>> >>>> first = True >>>> fig = plt.figure() >>>> for file in files: >>>> hdu = fits.open(file) >>>> image = hdu[0].data >>>> hdu.close() >>>> if first: >>>> ax = fig,add_subplot(1,1,1) >>>> im = ax.imshow(image) >>>> plt.show() >>>> first = False >>>> else: >>>> im.set_data(image) >>>> plt.draw() >>>> ans = raw_input('continue?') >>>> if ans == 'n': >>>> break >>>> >>>> Jon >>>> >>>> >>>> On Tue, Oct 14, 2014 at 10:42 AM, Benjamin Root <ben...@ou...> >>>> wrote: >>>> >>>>> Also, you aren't updating "first" after the first call, so it is >>>>> constantly making new axes and recalling imshow(). >>>>> >>>>> Ben Root >>>>> >>>>> On Tue, Oct 14, 2014 at 10:41 AM, Benjamin Root <ben...@ou...> >>>>> wrote: >>>>> >>>>>> What is happening is that you are not telling the image to redraw, so >>>>>> you are only seeing it refresh for other reasons. Try adding a fig.draw() >>>>>> call prior to the raw_input() call. >>>>>> >>>>>> Cheers! >>>>>> Ben Root >>>>>> >>>>>> On Tue, Oct 14, 2014 at 10:03 AM, Slavin, Jonathan < >>>>>> js...@cf...> wrote: >>>>>> >>>>>>> Hi all, >>>>>>> >>>>>>> In my work lately I have often wanted to browse through a series of >>>>>>> images. This means displaying the image(s), looking at it/them and then >>>>>>> continuing. I have coded this in a few different ways, but it is generally >>>>>>> pretty slow -- which is to say that the image display takes more than a >>>>>>> couple seconds (~4) after I tell it to continue to the next image. I >>>>>>> tested the loop without image display and it was a factor of ~80 times >>>>>>> faster than it was with image display, so it's doesn't have anything to do >>>>>>> with reading the images from disk. My latest approach is basically: >>>>>>> first = True >>>>>>> fig = plt.figure() >>>>>>> for file in imagefiles: >>>>>>> # read in image data (fits files) >>>>>>> if first: >>>>>>> ax = fig.add_suplot(1,1,1) >>>>>>> im = ax.imshow(image) >>>>>>> else: >>>>>>> im.set_data(image) >>>>>>> ans = raw_input('continue?') >>>>>>> if ans == 'n': >>>>>>> break >>>>>>> >>>>>>> Is there a more efficient way to do this? >>>>>>> >>>>>>> Regards, >>>>>>> Jon >>>>>>> >>>>>>> -- >>>>>>> ________________________________________________________ >>>>>>> Jonathan D. Slavin Harvard-Smithsonian CfA >>>>>>> js...@cf... 60 Garden Street, MS 83 >>>>>>> phone: (617) 496-7981 Cambridge, MA 02138-1516 >>>>>>> fax: (617) 496-7577 USA >>>>>>> ________________________________________________________ >>>>>>> >>>>>>> >>>>>>> >>>>>>> ------------------------------------------------------------------------------ >>>>>>> Comprehensive Server Monitoring with Site24x7. >>>>>>> Monitor 10 servers for $9/Month. >>>>>>> Get alerted through email, SMS, voice calls or mobile push >>>>>>> notifications. >>>>>>> Take corrective actions from your mobile device. >>>>>>> http://p.sf.net/sfu/Zoho >>>>>>> _______________________________________________ >>>>>>> Matplotlib-users mailing list >>>>>>> Mat...@li... >>>>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>>> >>>> -- >>>> ________________________________________________________ >>>> Jonathan D. Slavin Harvard-Smithsonian CfA >>>> js...@cf... 60 Garden Street, MS 83 >>>> phone: (617) 496-7981 Cambridge, MA 02138-1516 >>>> fax: (617) 496-7577 USA >>>> ________________________________________________________ >>>> >>>> >>> >>> >>> -- >>> ________________________________________________________ >>> Jonathan D. Slavin Harvard-Smithsonian CfA >>> js...@cf... 60 Garden Street, MS 83 >>> phone: (617) 496-7981 Cambridge, MA 02138-1516 >>> fax: (617) 496-7577 USA >>> ________________________________________________________ >>> >>> >> >> >> ------------------------------------------------------------------------------ >> Comprehensive Server Monitoring with Site24x7. >> Monitor 10 servers for $9/Month. >> Get alerted through email, SMS, voice calls or mobile push notifications. >> Take corrective actions from your mobile device. >> http://p.sf.net/sfu/Zoho >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > > > -- > ************************************* > Chris Beaumont > Senior Software Engineer > Harvard Center for Astrophysics > 60 Garden Street, MS 42 > Cambridge, MA 02138 > chrisbeaumont.org > ************************************* > -- ________________________________________________________ Jonathan D. Slavin Harvard-Smithsonian CfA js...@cf... 60 Garden Street, MS 83 phone: (617) 496-7981 Cambridge, MA 02138-1516 fax: (617) 496-7577 USA ________________________________________________________ |
From: Thomas C. <tca...@gm...> - 2014-10-14 16:40:41
|
I am happy to announce that I have tagged a release candidate for 1.4.1. This is a bug-fix release which fixes most of the bug that popped up in 1.4.0 including: - setup.py does not die when freetype is not installed - reverts the changes to interactive plotting so `ion` will work as expected - sundry unicode fixes (looking up user folders, importing seaborn/pandas/networkx with macosx backend - fixed boxplot regressions The tarball is available from github, sourceforge and can be install via pip install matplotlib==1.4.1rc1 Tom -- Thomas Caswell tca...@gm... |
From: Chris B. <cbe...@cf...> - 2014-10-14 16:19:06
|
I've found that, for big images, the *first* draw is very slow, due to the intensity scaling of the image, which happens at full resolution. Panning and zooming afterwards is fast because the intensity scaling is cached, but changing the data array or updating the norm kwarg is slow again. I made ModestImage (https://github.com/ChrisBeaumont/mpl-modest-image) to deal with this -- it dynamically downsamples images to screen resolution. This makes the first draw after updating the data or norm much faster, while slowing down subsequent redraws. Perhaps this could help you out? cheers, chris On Tue, Oct 14, 2014 at 12:08 PM, Benjamin Root <ben...@ou...> wrote: > Only if there are multiple figures (plt.draw() operates on the current > active figure, while fig.draw() explicitly operates upon that figure). > Another possibility is that the bottleneck truly is the IO. Depending on > exactly how fits work, it might be lazily loading data for you, so the test > without the display of the images might not actually be loading any data > into memory. > > Ben Root > > On Tue, Oct 14, 2014 at 11:22 AM, Slavin, Jonathan < > js...@cf...> wrote: > >> Hmm. I just saw that you suggest fig.draw(). Is there a difference with >> plt.draw()? >> >> Jon >> >> On Tue, Oct 14, 2014 at 11:20 AM, Slavin, Jonathan < >> js...@cf...> wrote: >> >>> Hi Ben, >>> >>> Sorry, in my little example, I left out a few things. I do update first >>> after the first call. And I do call draw() after other calls. So here is >>> a more accurate representation of what I do: >>> >>> first = True >>> fig = plt.figure() >>> for file in files: >>> hdu = fits.open(file) >>> image = hdu[0].data >>> hdu.close() >>> if first: >>> ax = fig,add_subplot(1,1,1) >>> im = ax.imshow(image) >>> plt.show() >>> first = False >>> else: >>> im.set_data(image) >>> plt.draw() >>> ans = raw_input('continue?') >>> if ans == 'n': >>> break >>> >>> Jon >>> >>> >>> On Tue, Oct 14, 2014 at 10:42 AM, Benjamin Root <ben...@ou...> wrote: >>> >>>> Also, you aren't updating "first" after the first call, so it is >>>> constantly making new axes and recalling imshow(). >>>> >>>> Ben Root >>>> >>>> On Tue, Oct 14, 2014 at 10:41 AM, Benjamin Root <ben...@ou...> >>>> wrote: >>>> >>>>> What is happening is that you are not telling the image to redraw, so >>>>> you are only seeing it refresh for other reasons. Try adding a fig.draw() >>>>> call prior to the raw_input() call. >>>>> >>>>> Cheers! >>>>> Ben Root >>>>> >>>>> On Tue, Oct 14, 2014 at 10:03 AM, Slavin, Jonathan < >>>>> js...@cf...> wrote: >>>>> >>>>>> Hi all, >>>>>> >>>>>> In my work lately I have often wanted to browse through a series of >>>>>> images. This means displaying the image(s), looking at it/them and then >>>>>> continuing. I have coded this in a few different ways, but it is generally >>>>>> pretty slow -- which is to say that the image display takes more than a >>>>>> couple seconds (~4) after I tell it to continue to the next image. I >>>>>> tested the loop without image display and it was a factor of ~80 times >>>>>> faster than it was with image display, so it's doesn't have anything to do >>>>>> with reading the images from disk. My latest approach is basically: >>>>>> first = True >>>>>> fig = plt.figure() >>>>>> for file in imagefiles: >>>>>> # read in image data (fits files) >>>>>> if first: >>>>>> ax = fig.add_suplot(1,1,1) >>>>>> im = ax.imshow(image) >>>>>> else: >>>>>> im.set_data(image) >>>>>> ans = raw_input('continue?') >>>>>> if ans == 'n': >>>>>> break >>>>>> >>>>>> Is there a more efficient way to do this? >>>>>> >>>>>> Regards, >>>>>> Jon >>>>>> >>>>>> -- >>>>>> ________________________________________________________ >>>>>> Jonathan D. Slavin Harvard-Smithsonian CfA >>>>>> js...@cf... 60 Garden Street, MS 83 >>>>>> phone: (617) 496-7981 Cambridge, MA 02138-1516 >>>>>> fax: (617) 496-7577 USA >>>>>> ________________________________________________________ >>>>>> >>>>>> >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> Comprehensive Server Monitoring with Site24x7. >>>>>> Monitor 10 servers for $9/Month. >>>>>> Get alerted through email, SMS, voice calls or mobile push >>>>>> notifications. >>>>>> Take corrective actions from your mobile device. >>>>>> http://p.sf.net/sfu/Zoho >>>>>> _______________________________________________ >>>>>> Matplotlib-users mailing list >>>>>> Mat...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>>>>> >>>>>> >>>>> >>>> >>> >>> >>> -- >>> ________________________________________________________ >>> Jonathan D. Slavin Harvard-Smithsonian CfA >>> js...@cf... 60 Garden Street, MS 83 >>> phone: (617) 496-7981 Cambridge, MA 02138-1516 >>> fax: (617) 496-7577 USA >>> ________________________________________________________ >>> >>> >> >> >> -- >> ________________________________________________________ >> Jonathan D. Slavin Harvard-Smithsonian CfA >> js...@cf... 60 Garden Street, MS 83 >> phone: (617) 496-7981 Cambridge, MA 02138-1516 >> fax: (617) 496-7577 USA >> ________________________________________________________ >> >> > > > ------------------------------------------------------------------------------ > Comprehensive Server Monitoring with Site24x7. > Monitor 10 servers for $9/Month. > Get alerted through email, SMS, voice calls or mobile push notifications. > Take corrective actions from your mobile device. > http://p.sf.net/sfu/Zoho > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- ************************************* Chris Beaumont Senior Software Engineer Harvard Center for Astrophysics 60 Garden Street, MS 42 Cambridge, MA 02138 chrisbeaumont.org ************************************* |
From: Benjamin R. <ben...@ou...> - 2014-10-14 16:08:40
|
Only if there are multiple figures (plt.draw() operates on the current active figure, while fig.draw() explicitly operates upon that figure). Another possibility is that the bottleneck truly is the IO. Depending on exactly how fits work, it might be lazily loading data for you, so the test without the display of the images might not actually be loading any data into memory. Ben Root On Tue, Oct 14, 2014 at 11:22 AM, Slavin, Jonathan <js...@cf...> wrote: > Hmm. I just saw that you suggest fig.draw(). Is there a difference with > plt.draw()? > > Jon > > On Tue, Oct 14, 2014 at 11:20 AM, Slavin, Jonathan < > js...@cf...> wrote: > >> Hi Ben, >> >> Sorry, in my little example, I left out a few things. I do update first >> after the first call. And I do call draw() after other calls. So here is >> a more accurate representation of what I do: >> >> first = True >> fig = plt.figure() >> for file in files: >> hdu = fits.open(file) >> image = hdu[0].data >> hdu.close() >> if first: >> ax = fig,add_subplot(1,1,1) >> im = ax.imshow(image) >> plt.show() >> first = False >> else: >> im.set_data(image) >> plt.draw() >> ans = raw_input('continue?') >> if ans == 'n': >> break >> >> Jon >> >> >> On Tue, Oct 14, 2014 at 10:42 AM, Benjamin Root <ben...@ou...> wrote: >> >>> Also, you aren't updating "first" after the first call, so it is >>> constantly making new axes and recalling imshow(). >>> >>> Ben Root >>> >>> On Tue, Oct 14, 2014 at 10:41 AM, Benjamin Root <ben...@ou...> wrote: >>> >>>> What is happening is that you are not telling the image to redraw, so >>>> you are only seeing it refresh for other reasons. Try adding a fig.draw() >>>> call prior to the raw_input() call. >>>> >>>> Cheers! >>>> Ben Root >>>> >>>> On Tue, Oct 14, 2014 at 10:03 AM, Slavin, Jonathan < >>>> js...@cf...> wrote: >>>> >>>>> Hi all, >>>>> >>>>> In my work lately I have often wanted to browse through a series of >>>>> images. This means displaying the image(s), looking at it/them and then >>>>> continuing. I have coded this in a few different ways, but it is generally >>>>> pretty slow -- which is to say that the image display takes more than a >>>>> couple seconds (~4) after I tell it to continue to the next image. I >>>>> tested the loop without image display and it was a factor of ~80 times >>>>> faster than it was with image display, so it's doesn't have anything to do >>>>> with reading the images from disk. My latest approach is basically: >>>>> first = True >>>>> fig = plt.figure() >>>>> for file in imagefiles: >>>>> # read in image data (fits files) >>>>> if first: >>>>> ax = fig.add_suplot(1,1,1) >>>>> im = ax.imshow(image) >>>>> else: >>>>> im.set_data(image) >>>>> ans = raw_input('continue?') >>>>> if ans == 'n': >>>>> break >>>>> >>>>> Is there a more efficient way to do this? >>>>> >>>>> Regards, >>>>> Jon >>>>> >>>>> -- >>>>> ________________________________________________________ >>>>> Jonathan D. Slavin Harvard-Smithsonian CfA >>>>> js...@cf... 60 Garden Street, MS 83 >>>>> phone: (617) 496-7981 Cambridge, MA 02138-1516 >>>>> fax: (617) 496-7577 USA >>>>> ________________________________________________________ >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Comprehensive Server Monitoring with Site24x7. >>>>> Monitor 10 servers for $9/Month. >>>>> Get alerted through email, SMS, voice calls or mobile push >>>>> notifications. >>>>> Take corrective actions from your mobile device. >>>>> http://p.sf.net/sfu/Zoho >>>>> _______________________________________________ >>>>> Matplotlib-users mailing list >>>>> Mat...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>>>> >>>>> >>>> >>> >> >> >> -- >> ________________________________________________________ >> Jonathan D. Slavin Harvard-Smithsonian CfA >> js...@cf... 60 Garden Street, MS 83 >> phone: (617) 496-7981 Cambridge, MA 02138-1516 >> fax: (617) 496-7577 USA >> ________________________________________________________ >> >> > > > -- > ________________________________________________________ > Jonathan D. Slavin Harvard-Smithsonian CfA > js...@cf... 60 Garden Street, MS 83 > phone: (617) 496-7981 Cambridge, MA 02138-1516 > fax: (617) 496-7577 USA > ________________________________________________________ > > |
From: Slavin, J. <js...@cf...> - 2014-10-14 15:22:13
|
Hmm. I just saw that you suggest fig.draw(). Is there a difference with plt.draw()? Jon On Tue, Oct 14, 2014 at 11:20 AM, Slavin, Jonathan <js...@cf...> wrote: > Hi Ben, > > Sorry, in my little example, I left out a few things. I do update first > after the first call. And I do call draw() after other calls. So here is > a more accurate representation of what I do: > > first = True > fig = plt.figure() > for file in files: > hdu = fits.open(file) > image = hdu[0].data > hdu.close() > if first: > ax = fig,add_subplot(1,1,1) > im = ax.imshow(image) > plt.show() > first = False > else: > im.set_data(image) > plt.draw() > ans = raw_input('continue?') > if ans == 'n': > break > > Jon > > > On Tue, Oct 14, 2014 at 10:42 AM, Benjamin Root <ben...@ou...> wrote: > >> Also, you aren't updating "first" after the first call, so it is >> constantly making new axes and recalling imshow(). >> >> Ben Root >> >> On Tue, Oct 14, 2014 at 10:41 AM, Benjamin Root <ben...@ou...> wrote: >> >>> What is happening is that you are not telling the image to redraw, so >>> you are only seeing it refresh for other reasons. Try adding a fig.draw() >>> call prior to the raw_input() call. >>> >>> Cheers! >>> Ben Root >>> >>> On Tue, Oct 14, 2014 at 10:03 AM, Slavin, Jonathan < >>> js...@cf...> wrote: >>> >>>> Hi all, >>>> >>>> In my work lately I have often wanted to browse through a series of >>>> images. This means displaying the image(s), looking at it/them and then >>>> continuing. I have coded this in a few different ways, but it is generally >>>> pretty slow -- which is to say that the image display takes more than a >>>> couple seconds (~4) after I tell it to continue to the next image. I >>>> tested the loop without image display and it was a factor of ~80 times >>>> faster than it was with image display, so it's doesn't have anything to do >>>> with reading the images from disk. My latest approach is basically: >>>> first = True >>>> fig = plt.figure() >>>> for file in imagefiles: >>>> # read in image data (fits files) >>>> if first: >>>> ax = fig.add_suplot(1,1,1) >>>> im = ax.imshow(image) >>>> else: >>>> im.set_data(image) >>>> ans = raw_input('continue?') >>>> if ans == 'n': >>>> break >>>> >>>> Is there a more efficient way to do this? >>>> >>>> Regards, >>>> Jon >>>> >>>> -- >>>> ________________________________________________________ >>>> Jonathan D. Slavin Harvard-Smithsonian CfA >>>> js...@cf... 60 Garden Street, MS 83 >>>> phone: (617) 496-7981 Cambridge, MA 02138-1516 >>>> fax: (617) 496-7577 USA >>>> ________________________________________________________ >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Comprehensive Server Monitoring with Site24x7. >>>> Monitor 10 servers for $9/Month. >>>> Get alerted through email, SMS, voice calls or mobile push >>>> notifications. >>>> Take corrective actions from your mobile device. >>>> http://p.sf.net/sfu/Zoho >>>> _______________________________________________ >>>> Matplotlib-users mailing list >>>> Mat...@li... >>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>>> >>>> >>> >> > > > -- > ________________________________________________________ > Jonathan D. Slavin Harvard-Smithsonian CfA > js...@cf... 60 Garden Street, MS 83 > phone: (617) 496-7981 Cambridge, MA 02138-1516 > fax: (617) 496-7577 USA > ________________________________________________________ > > -- ________________________________________________________ Jonathan D. Slavin Harvard-Smithsonian CfA js...@cf... 60 Garden Street, MS 83 phone: (617) 496-7981 Cambridge, MA 02138-1516 fax: (617) 496-7577 USA ________________________________________________________ |
From: Slavin, J. <js...@cf...> - 2014-10-14 15:20:56
|
Hi Ben, Sorry, in my little example, I left out a few things. I do update first after the first call. And I do call draw() after other calls. So here is a more accurate representation of what I do: first = True fig = plt.figure() for file in files: hdu = fits.open(file) image = hdu[0].data hdu.close() if first: ax = fig,add_subplot(1,1,1) im = ax.imshow(image) plt.show() first = False else: im.set_data(image) plt.draw() ans = raw_input('continue?') if ans == 'n': break Jon On Tue, Oct 14, 2014 at 10:42 AM, Benjamin Root <ben...@ou...> wrote: > Also, you aren't updating "first" after the first call, so it is > constantly making new axes and recalling imshow(). > > Ben Root > > On Tue, Oct 14, 2014 at 10:41 AM, Benjamin Root <ben...@ou...> wrote: > >> What is happening is that you are not telling the image to redraw, so you >> are only seeing it refresh for other reasons. Try adding a fig.draw() call >> prior to the raw_input() call. >> >> Cheers! >> Ben Root >> >> On Tue, Oct 14, 2014 at 10:03 AM, Slavin, Jonathan < >> js...@cf...> wrote: >> >>> Hi all, >>> >>> In my work lately I have often wanted to browse through a series of >>> images. This means displaying the image(s), looking at it/them and then >>> continuing. I have coded this in a few different ways, but it is generally >>> pretty slow -- which is to say that the image display takes more than a >>> couple seconds (~4) after I tell it to continue to the next image. I >>> tested the loop without image display and it was a factor of ~80 times >>> faster than it was with image display, so it's doesn't have anything to do >>> with reading the images from disk. My latest approach is basically: >>> first = True >>> fig = plt.figure() >>> for file in imagefiles: >>> # read in image data (fits files) >>> if first: >>> ax = fig.add_suplot(1,1,1) >>> im = ax.imshow(image) >>> else: >>> im.set_data(image) >>> ans = raw_input('continue?') >>> if ans == 'n': >>> break >>> >>> Is there a more efficient way to do this? >>> >>> Regards, >>> Jon >>> >>> -- >>> ________________________________________________________ >>> Jonathan D. Slavin Harvard-Smithsonian CfA >>> js...@cf... 60 Garden Street, MS 83 >>> phone: (617) 496-7981 Cambridge, MA 02138-1516 >>> fax: (617) 496-7577 USA >>> ________________________________________________________ >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Comprehensive Server Monitoring with Site24x7. >>> Monitor 10 servers for $9/Month. >>> Get alerted through email, SMS, voice calls or mobile push notifications. >>> Take corrective actions from your mobile device. >>> http://p.sf.net/sfu/Zoho >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >>> >> > -- ________________________________________________________ Jonathan D. Slavin Harvard-Smithsonian CfA js...@cf... 60 Garden Street, MS 83 phone: (617) 496-7981 Cambridge, MA 02138-1516 fax: (617) 496-7577 USA ________________________________________________________ |
From: Benjamin R. <ben...@ou...> - 2014-10-14 14:42:40
|
Also, you aren't updating "first" after the first call, so it is constantly making new axes and recalling imshow(). Ben Root On Tue, Oct 14, 2014 at 10:41 AM, Benjamin Root <ben...@ou...> wrote: > What is happening is that you are not telling the image to redraw, so you > are only seeing it refresh for other reasons. Try adding a fig.draw() call > prior to the raw_input() call. > > Cheers! > Ben Root > > On Tue, Oct 14, 2014 at 10:03 AM, Slavin, Jonathan < > js...@cf...> wrote: > >> Hi all, >> >> In my work lately I have often wanted to browse through a series of >> images. This means displaying the image(s), looking at it/them and then >> continuing. I have coded this in a few different ways, but it is generally >> pretty slow -- which is to say that the image display takes more than a >> couple seconds (~4) after I tell it to continue to the next image. I >> tested the loop without image display and it was a factor of ~80 times >> faster than it was with image display, so it's doesn't have anything to do >> with reading the images from disk. My latest approach is basically: >> first = True >> fig = plt.figure() >> for file in imagefiles: >> # read in image data (fits files) >> if first: >> ax = fig.add_suplot(1,1,1) >> im = ax.imshow(image) >> else: >> im.set_data(image) >> ans = raw_input('continue?') >> if ans == 'n': >> break >> >> Is there a more efficient way to do this? >> >> Regards, >> Jon >> >> -- >> ________________________________________________________ >> Jonathan D. Slavin Harvard-Smithsonian CfA >> js...@cf... 60 Garden Street, MS 83 >> phone: (617) 496-7981 Cambridge, MA 02138-1516 >> fax: (617) 496-7577 USA >> ________________________________________________________ >> >> >> >> ------------------------------------------------------------------------------ >> Comprehensive Server Monitoring with Site24x7. >> Monitor 10 servers for $9/Month. >> Get alerted through email, SMS, voice calls or mobile push notifications. >> Take corrective actions from your mobile device. >> http://p.sf.net/sfu/Zoho >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > |
From: Benjamin R. <ben...@ou...> - 2014-10-14 14:41:47
|
What is happening is that you are not telling the image to redraw, so you are only seeing it refresh for other reasons. Try adding a fig.draw() call prior to the raw_input() call. Cheers! Ben Root On Tue, Oct 14, 2014 at 10:03 AM, Slavin, Jonathan <js...@cf...> wrote: > Hi all, > > In my work lately I have often wanted to browse through a series of > images. This means displaying the image(s), looking at it/them and then > continuing. I have coded this in a few different ways, but it is generally > pretty slow -- which is to say that the image display takes more than a > couple seconds (~4) after I tell it to continue to the next image. I > tested the loop without image display and it was a factor of ~80 times > faster than it was with image display, so it's doesn't have anything to do > with reading the images from disk. My latest approach is basically: > first = True > fig = plt.figure() > for file in imagefiles: > # read in image data (fits files) > if first: > ax = fig.add_suplot(1,1,1) > im = ax.imshow(image) > else: > im.set_data(image) > ans = raw_input('continue?') > if ans == 'n': > break > > Is there a more efficient way to do this? > > Regards, > Jon > > -- > ________________________________________________________ > Jonathan D. Slavin Harvard-Smithsonian CfA > js...@cf... 60 Garden Street, MS 83 > phone: (617) 496-7981 Cambridge, MA 02138-1516 > fax: (617) 496-7577 USA > ________________________________________________________ > > > > ------------------------------------------------------------------------------ > Comprehensive Server Monitoring with Site24x7. > Monitor 10 servers for $9/Month. > Get alerted through email, SMS, voice calls or mobile push notifications. > Take corrective actions from your mobile device. > http://p.sf.net/sfu/Zoho > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: Slavin, J. <js...@cf...> - 2014-10-14 14:32:31
|
Hi all, In my work lately I have often wanted to browse through a series of images. This means displaying the image(s), looking at it/them and then continuing. I have coded this in a few different ways, but it is generally pretty slow -- which is to say that the image display takes more than a couple seconds (~4) after I tell it to continue to the next image. I tested the loop without image display and it was a factor of ~80 times faster than it was with image display, so it's doesn't have anything to do with reading the images from disk. My latest approach is basically: first = True fig = plt.figure() for file in imagefiles: # read in image data (fits files) if first: ax = fig.add_suplot(1,1,1) im = ax.imshow(image) else: im.set_data(image) ans = raw_input('continue?') if ans == 'n': break Is there a more efficient way to do this? Regards, Jon -- ________________________________________________________ Jonathan D. Slavin Harvard-Smithsonian CfA js...@cf... 60 Garden Street, MS 83 phone: (617) 496-7981 Cambridge, MA 02138-1516 fax: (617) 496-7577 USA ________________________________________________________ |
From: Sourav C. <sr...@gm...> - 2014-10-14 05:09:45
|
Can somebody help me to plot the wind vectors in spstere projection reading data from a grb2 file *without using Dataset (netcdf4*)? Thanks Sourav |
From: Thomas C. <tho...@mo...> - 2014-10-13 23:01:58
|
Dear All, [Apologies for cross-posting]. I'm pleased to announce the release of the latest version of the Python SkewT <https://pypi.python.org/pypi/SkewT> package on PyPI for analysis and plotting of atmospheric profile data. Easy implementation of these plots is a capability we feel has been missing from the Python for Atmospheric Sciences community. This package has been around for a little while and maintained as a side project, but with the release of Matplotlib 1.4 and in particular the showcasing of skewt plotting capabilities (see here <http://matplotlib.org/users/whats_new.html#new-plotting-features>), we felt it was time to update the package. It's also fully backwards compatible with older versions of Matplotlib. New features include calculation of CAPE and CIN for standard parcel definitions from the NOAA Storm Prediction Centre <http://www.spc.noaa.gov/sfctest/help/sfcoa.html>, as well as for arbitrary parcels of your own definition. SkewT is a collaborative project and has relied on the work of others, who I thank for their contributions. If you're interested in severe weather and Python, check this package out and tell us what you think. We want to keep improving it and feedback from the community is vital to do this properly. -- Dr. Thomas Chubb Postdoctoral Fellow School of Earth, Atmosphere and Environment Monash University, VIC 3800 Ph. +613 9902 4212 |
From: Thomas C. <tca...@gm...> - 2014-10-11 21:18:33
|
See https://github.com/matplotlib/matplotlib/pull/3638 That might help to make sure that things tear them selves down in the right order. Tom On Sat, Oct 11, 2014 at 10:12 AM, Phil Elson <pel...@gm...> wrote: > > On 10 October 2014 19:10, Thomas Caswell <tca...@gm...> wrote: >> >> I suspect a better fix is to change all of the staticmethods -> >> classmethods > > > > +1 -- Thomas Caswell tca...@gm... |
From: Phil E. <pel...@gm...> - 2014-10-11 14:12:13
|
On 10 October 2014 19:10, Thomas Caswell <tca...@gm...> wrote: > I suspect a better fix is to change all of the staticmethods -> > classmethods +1 |
From: Thomas C. <tca...@gm...> - 2014-10-10 21:27:50
|
You need 1.4.0 as the 3D quiver code is not in 1.3.1. On Fri, Oct 10, 2014 at 5:02 PM, Thomas Proctor <The...@gm...> wrote: > I'm trying to generate a 3D quiver plot. When I try running the sample > available at > http://matplotlib.org/mpl_examples/mplot3d/quiver3d_demo.py > I get a "ValueError: too many values to unpack" error. I'm using matplotlib > 1.3.1 (the version available on the Ubuntu repositories). > > Does anyone know what's up with this? I'm assuming that this sample will > work if I had the right version, can anyone tell me what version I would > need? > > Thanks! > > > > ------------------------------------------------------------------------------ > Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer > Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports > Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper > Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer > http://p.sf.net/sfu/Zoho > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Thomas Caswell tca...@gm... |
From: Benjamin R. <ben...@ou...> - 2014-10-10 21:24:05
|
chances are, something is wonky with the inputs that is causing the broadcasting not to work correctly. Could you post a simple, self-contained code example? Ben Root On Fri, Oct 10, 2014 at 5:02 PM, Thomas Proctor <The...@gm...> wrote: > I'm trying to generate a 3D quiver plot. When I try running the sample > available at <http://matplotlib.org/mpl_examples/mplot3d/quiver3d_demo.py> > http://matplotlib.org/mpl_examples/mplot3d/quiver3d_demo.py > I get a "ValueError: too many values to unpack" error. I'm using > matplotlib 1.3.1 (the version available on the Ubuntu repositories). > > Does anyone know what's up with this? I'm assuming that this sample will > work if I had the right version, can anyone tell me what version I would > need? > > Thanks! > >> > > > ------------------------------------------------------------------------------ > Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer > Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports > Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper > Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer > http://p.sf.net/sfu/Zoho > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: Thomas P. <The...@gm...> - 2014-10-10 21:03:46
|
I'm trying to generate a 3D quiver plot. When I try running the sample available at <http://matplotlib.org/mpl_examples/mplot3d/quiver3d_demo.py> http://matplotlib.org/mpl_examples/mplot3d/quiver3d_demo.py I get a "ValueError: too many values to unpack" error. I'm using matplotlib 1.3.1 (the version available on the Ubuntu repositories). Does anyone know what's up with this? I'm assuming that this sample will work if I had the right version, can anyone tell me what version I would need? Thanks! > |
From: Duke, C. <DU...@Gr...> - 2014-10-10 20:51:28
|
Yes, I did. Same result as with cla(). Thanks, Charlie -----Original Message----- From: Sterling Smith [mailto:sm...@fu...] Sent: Friday, October 10, 2014 11:30 AM To: Duke, Charles Cc: mat...@li... Subject: Re: [Matplotlib-users] twinx cla problem This is not tested, but did you try ax2.clear() instead? -Sterling On Oct 10, 2014, at 7:45AM, Duke, Charles wrote: > With matplotlib 1.4.0 the cla() method for the twinx axes also clears the primary axes. With matplotlib 1.3.1 the method only clears the twinx axes as expected. I have a much longer program where the twinx axes must be cleared while retaining the primary axis plot. I would prefer not to replot the entire graph each time the twinx axes change. You can see this by adding the cla method to the matplotlib web site example, two_scales.py, shown below. > > I have matplotlib installed via the anaconda package. Matplotlib 1.4.0 is from anaconda 2.1.0. Matplotlib 1.3.1 is from 1.9 versions of the anaconda package. > > Linux version: > Linux gamow 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3 x86_64 > GNU/Linux Same cla() result on osX 10.9.4. > > Same result for backends Qt4Agg and TkAgg; the cla() method cleared both axes. > I also tried various other options such as setting ax2.hold(False) prior to replotting ax2. However, once again ax1 was cleared. The ax2 clear commands seem to apply to the ax1 axis as well??? These options worked as expected for the earlier matplotlib version, clearing only the ax2 axis. > > Here's the code: if you execute the code, you should see a blank figure with the cla() included and the usual two graphs without the cla() method. > > -------------------------------------------------------------------- > import numpy as np > import matplotlib.pyplot as plt > > fig, ax1 = plt.subplots() > t = np.arange(0.01, 10.0, 0.01) > s1 = np.exp(t) > ax1.plot(t, s1, 'b-') > ax1.set_xlabel('time (s)') > # Make the y-axis label and tick labels match the line color. > ax1.set_ylabel('exp', color='b') > for tl in ax1.get_yticklabels(): > tl.set_color('b') > > ax2 = ax1.twinx() > s2 = np.sin(2*np.pi*t) > ax2.plot(t, s2, 'r.') > ax2.set_ylabel('sin', color='r') > for tl in ax2.get_yticklabels(): > tl.set_color('r') > > # single line addition to the two_scales.py example # clears both ax2 > and ax1 under matplotlib 1.4.0, clears only ax2 under matplotlib 1.3.1 > # obviously, same result with ax2.clear() method > ax2.cla() > > plt.show() > > > I would appreciate any help; this looks like a bug in the latest version of matplotlib. > I could not find any reference to this problem in earlier posts. > > Thanks, > Charlie > > ---------------------------------------------------------------------- > -------- Meet PCI DSS 3.0 Compliance Requirements with EventLog > Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI > DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download > White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with > EventLog Analyzer > http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg. > clktrk_______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Eric F. <ef...@ha...> - 2014-10-10 18:42:43
|
On 2014/10/10, 4:45 AM, Duke, Charles wrote: > With matplotlib 1.4.0 the cla() method for the twinx axes also clears > the primary axes. With matplotlib 1.3.1 the method only clears the > twinx axes as expected. I have a much longer program where the twinx > axes must be cleared while retaining the primary axis plot. I would > prefer not to replot the entire graph each time the twinx axes change. > You can see this by adding the cla method to the matplotlib web site > example, two_scales.py, shown below. > > I have matplotlib installed via the anaconda package. Matplotlib 1.4.0 > is from anaconda 2.1.0. Matplotlib 1.3.1 is from 1.9 versions of the > anaconda package. > > Linux version: > > Linux gamow 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3 x86_64 GNU/Linux > > Same cla() result on osX 10.9.4. > > Same result for backends Qt4Agg and TkAgg; the cla() method cleared > both axes. > > I also tried various other options such as setting ax2.hold(False) prior > to replotting ax2. However, once again ax1 was cleared. The ax2 clear > commands seem to apply to the ax1 axis as well??? These options worked > as expected for the earlier matplotlib version, clearing only the ax2 axis. > > Here’s the code: if you execute the code, you should see a blank figure > with the cla() included and the usual two graphs without the cla() method. > > -------------------------------------------------------------------- > > import numpy as np > > import matplotlib.pyplot as plt > > fig, ax1 = plt.subplots() > > t = np.arange(0.01, 10.0, 0.01) > > s1 = np.exp(t) > > ax1.plot(t, s1, 'b-') > > ax1.set_xlabel('time (s)') > > # Make the y-axis label and tick labels match the line color. > > ax1.set_ylabel('exp', color='b') > > for tl in ax1.get_yticklabels(): > > tl.set_color('b') > > ax2 = ax1.twinx() > > s2 = np.sin(2*np.pi*t) > > ax2.plot(t, s2, 'r.') > > ax2.set_ylabel('sin', color='r') > > for tl in ax2.get_yticklabels(): > > tl.set_color('r') > > # single line addition to the two_scales.py example > > # clears both ax2 and ax1 under matplotlib 1.4.0, clears only ax2 under > matplotlib 1.3.1 > > # obviously, same result with ax2.clear() method > > ax2.cla() > > plt.show() > > I would appreciate any help; this looks like a bug in the latest > version of matplotlib. Charlie, I agree--it does look like a regression in 1.4. Would you post it as a github issue, please? Thank you. Eric > > I could not find any reference to this problem in earlier posts. > > Thanks, > > Charlie > > > > ------------------------------------------------------------------------------ > Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer > Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports > Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper > Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer > http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk > > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Thomas C. <tca...@gm...> - 2014-10-10 18:11:06
|
Something is going really sideways on your system as `Gcf` is the class that the static method is a member of. If you have the method to call it, then you have the class defined. My guess is there is some race condition is the cleanup-at-exit code where the system is cleaning up the class object before this function is getting run. I suspect a better fix is to change all of the staticmethods -> classmethods Tom On Fri, Oct 10, 2014 at 1:38 PM, Mark Janikas <mja...@es...> wrote: > Thanks for pointer on the None…. Just got the future warning in my code when > comparing a numpy array param in a class of mine that defaults to None. > That should be solved differently… but I have plenty of other params that > default to None and I will change them accordingly…. > > > > Back to the traceback… it occurs on matplotlib 1.3 AND 1.4 > > > > TY, > > > > MJ > > > > From: ben...@gm... [mailto:ben...@gm...] On Behalf Of > Benjamin Root > Sent: Wednesday, October 8, 2014 6:20 PM > To: Mark Janikas > Cc: Matplotlib Users > Subject: Re: [Matplotlib-users] FW: traceback when import matplotlib.pyplot > twice > > > > Which version of matplotlib and which backend? > > Also, don't use == or != when comparing to None. Use "is" and "is not". > > Ben Root > > > ------------------------------------------------------------------------------ > Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer > Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports > Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper > Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer > http://p.sf.net/sfu/Zoho > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Thomas Caswell tca...@gm... |
From: Mark J. <mja...@es...> - 2014-10-10 17:38:15
|
Thanks for pointer on the None…. Just got the future warning in my code when comparing a numpy array param in a class of mine that defaults to None. That should be solved differently… but I have plenty of other params that default to None and I will change them accordingly…. Back to the traceback… it occurs on matplotlib 1.3 AND 1.4 TY, MJ From: ben...@gm... [mailto:ben...@gm...] On Behalf Of Benjamin Root Sent: Wednesday, October 8, 2014 6:20 PM To: Mark Janikas Cc: Matplotlib Users Subject: Re: [Matplotlib-users] FW: traceback when import matplotlib.pyplot twice Which version of matplotlib and which backend? Also, don't use == or != when comparing to None. Use "is" and "is not". Ben Root |