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
(8) |
2
(14) |
3
(22) |
4
(13) |
5
(11) |
6
(12) |
7
(4) |
|
8
(6) |
9
(19) |
10
(14) |
11
(16) |
12
(6) |
13
(15) |
14
(6) |
|
15
(8) |
16
(22) |
17
(17) |
18
(8) |
19
(16) |
20
(19) |
21
(3) |
|
22
(6) |
23
(18) |
24
(26) |
25
(17) |
26
(13) |
27
(18) |
28
(8) |
|
29
|
30
(14) |
31
(30) |
|
|
|
|
|
From: Eric F. <ef...@ha...> - 2009-03-15 20:39:08
|
Pablo Romero wrote: > Eric, > > I believe the problem is that my 19 levels are not evenly distributed; > > Lv=(1,3,5,6,7,8,9,10,12,14,16,18,20,25,30,35,40,50,75) No, I don't think that has much to do with it, unless the problem is that the colors of some levels are too similar. Again, please make a simple, complete, self-contained example, and we will go from there. I think what you want may be something like this: levs=[1,3,5,6,7,8,9,10,12,14,16,18,20,25,30,35,40,50,75] norm = mpl.colors.BoundaryNorm(levs, 256) z = rand(10,15)*14 # fake data covering only lower levs contourf(z, levs, norm=norm, cmap=cm.jet, extend='both') colorbar() > > the first part of the range starts at 1,3,5, but then includes 6,7,8,9, and then only goes with even numbers..10,12,14,16,18,20...then by 5 up until 35, then jumps by 10...etc. > > I know this seems strange, but this was done because Im plotting 'ocean wave heights' and these were decided to be the 'heights of interest' for the project Im working on. > Perfectly reasonable. > anyway, what I want is to be able to breakup the 'cm.jet' spectrum evenly based on the # of levels (and not on their values), and spread my levels evenly across the spectrum.... > > i.e., I want the first 6-7 levels to be evenly spread from blue to about green acros cm.jet's spectrum, approx. the next 6 levels to be evenly spread across cm.jet's yellow-orange part of the spectrum, and the last few levels to be evenly spread across the reds... > > Ideally, Id like to be able to use any colormap, and simply break up its color spectrum evenly, and then assign each distinct color to each level in my levels array. > > So, I guess I need a method to programatically, evenly break up cm.jet by the # of levels, create a colors array & pass this array to contourf(colors='mycolorsarray')... > > does this make sense? > > P.Romero > > ---------------------------------------- >> Date: Sun, 15 Mar 2009 08:32:32 -1000 >> From: ef...@ha... >> Subject: Re: [Matplotlib-users] question about levels & colormaps for contour functions >> To: rom...@ho... >> CC: mat...@li... >> >> Pablo Romero wrote: >>> Hi, >>> >>> I would like to know how I can pass an array of levels and also a colormap to the contour() function and have the levels span the entire colormap. example... >>> >>> if I do the following.... >>> >>> >>> Lv=(1,3,5,6,7,8,9,10,12,14,16,18,20,25,30,35,40,50,75) >>> >>> cs=plt.contourf(X,Y,waveheight,Lv,cmap=cm.jet,extend='both') >>> >>> >>> I would expect that contours that are in the higher levels (i.e., levels above value '14' in my levels array) would be plotted with lighter colors in the cm.jet spectrum; the greens, yellows,oranges,reds, etc. >>> >>> However, contourf is simply breaking up the lower,"dark blue" half of the cm.jet spectrum into small slices, and spreading all of my levels throughout only the bottom half of cm.jet. >>> >> I don't see the problem yet. Here is an attempt to recreate what it >> sounds like you are describing above (run in ipython -pylab): >> >> contourf(rand(10,12), arange(0,5.01,0.2), cmap=cm.jet, extend='both') >> colorbar() >> >> The data are all blue because they are in the 0-1 range, while the >> levels span the 0-5 range. The colorbar shows that the colormap is >> covering the latter range, as it should. >> >> If you can make a simple self-contained example like this, and then >> describe the difference between what it does and what you want it to do, >> we can figure out how to get your desired result. >> >> Eric >> >> >> >> >> >>> I followed this tutorial: >>> http://www.scipy.org/Cookbook/Matplotlib/ColormapTransformations >>> >>> that shows how to create a "discrete" colormap, but this also didnt work; the contourf function again simply sliced up the lower, blue colors and spread my all of my layers across the "blues" in my discrete colormap. >>> >>> >>> If I use a colors array instead of a colormap, I can achieve what I want. However, Id like to be able to use a colormap so that I dont have to manually create color arrays everytime that I want to change my colorscheme. >>> >>> So, how can I force contour() to spread my levels across THE WHOLE spectrum of a colormap? >>> >>> Please help, >>> >>> Thanks, >>> P.Romero >>> >>> >>> _________________________________________________________________ >>> Express your personality in color! Preview and select themes for Hotmail®. >>> http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=TXT_MSGTX_WL_HM_express_032009#colortheme >>> ------------------------------------------------------------------------------ >>> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are >>> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and >>> easily build your RIAs with Flex Builder, the Eclipse(TM)based development >>> software that enables intelligent coding and step-through debugging. >>> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > _________________________________________________________________ > Windows Live™ Contacts: Organize your contact list. > http://windowslive.com/connect/post/marcusatmicrosoft.spaces.live.com-Blog-cns!503D1D86EBB2B53C!2285.entry?ocid=TXT_TAGLM_WL_UGC_Contacts_032009 |
|
From: Pablo R. <rom...@ho...> - 2009-03-15 20:37:53
|
This is related to a previous question I had about colormaps; Im looking for a method to evenly split up a colormap into an RGB colors array. something like: def cmap_to_array(cmap,N): ... mycolors=cmap_to_array(cm.jet,20) lev=np.arange(1,20,1) cs=contourf(Z,lev,colors=mycolors) ... where 'mycolors' would be a 20x3 array with RGB values for 20 colors that represent the cm.jet spectrum broken up evenly into 20 colors... I believe colors array can contain RGB tuples, something like [[0.2,0.3,1],[0.3,0.5,1], ... ,[1,1,0]] should work. However, I dont know how to extract the tuples from an existing colormap. How can this be done? Please help... Thanks, P.Romero _________________________________________________________________ Windows Live™ Groups: Create an online spot for your favorite groups to meet. http://windowslive.com/online/groups?ocid=TXT_TAGLM_WL_groups_032009 |
|
From: Eric F. <ef...@ha...> - 2009-03-15 18:33:21
|
Pablo Romero wrote: > Hi, > > I would like to know how I can pass an array of levels and also a colormap to the contour() function and have the levels span the entire colormap. example... > > if I do the following.... > > > Lv=(1,3,5,6,7,8,9,10,12,14,16,18,20,25,30,35,40,50,75) > > cs=plt.contourf(X,Y,waveheight,Lv,cmap=cm.jet,extend='both') > > > I would expect that contours that are in the higher levels (i.e., levels above value '14' in my levels array) would be plotted with lighter colors in the cm.jet spectrum; the greens, yellows,oranges,reds, etc. > > However, contourf is simply breaking up the lower,"dark blue" half of the cm.jet spectrum into small slices, and spreading all of my levels throughout only the bottom half of cm.jet. > I don't see the problem yet. Here is an attempt to recreate what it sounds like you are describing above (run in ipython -pylab): contourf(rand(10,12), arange(0,5.01,0.2), cmap=cm.jet, extend='both') colorbar() The data are all blue because they are in the 0-1 range, while the levels span the 0-5 range. The colorbar shows that the colormap is covering the latter range, as it should. If you can make a simple self-contained example like this, and then describe the difference between what it does and what you want it to do, we can figure out how to get your desired result. Eric > > I followed this tutorial: > http://www.scipy.org/Cookbook/Matplotlib/ColormapTransformations > > that shows how to create a "discrete" colormap, but this also didnt work; the contourf function again simply sliced up the lower, blue colors and spread my all of my layers across the "blues" in my discrete colormap. > > > If I use a colors array instead of a colormap, I can achieve what I want. However, Id like to be able to use a colormap so that I dont have to manually create color arrays everytime that I want to change my colorscheme. > > So, how can I force contour() to spread my levels across THE WHOLE spectrum of a colormap? > > Please help, > > Thanks, > P.Romero > > > _________________________________________________________________ > Express your personality in color! Preview and select themes for Hotmail®. > http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=TXT_MSGTX_WL_HM_express_032009#colortheme > ------------------------------------------------------------------------------ > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are > powering Web 2.0 with engaging, cross-platform capabilities. Quickly and > easily build your RIAs with Flex Builder, the Eclipse(TM)based development > software that enables intelligent coding and step-through debugging. > Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Pablo R. <rom...@ho...> - 2009-03-15 17:00:14
|
Hi, I would like to know how I can pass an array of levels and also a colormap to the contour() function and have the levels span the entire colormap. example... if I do the following.... Lv=(1,3,5,6,7,8,9,10,12,14,16,18,20,25,30,35,40,50,75) cs=plt.contourf(X,Y,waveheight,Lv,cmap=cm.jet,extend='both') I would expect that contours that are in the higher levels (i.e., levels above value '14' in my levels array) would be plotted with lighter colors in the cm.jet spectrum; the greens, yellows,oranges,reds, etc. However, contourf is simply breaking up the lower,"dark blue" half of the cm.jet spectrum into small slices, and spreading all of my levels throughout only the bottom half of cm.jet. I followed this tutorial: http://www.scipy.org/Cookbook/Matplotlib/ColormapTransformations that shows how to create a "discrete" colormap, but this also didnt work; the contourf function again simply sliced up the lower, blue colors and spread my all of my layers across the "blues" in my discrete colormap. If I use a colors array instead of a colormap, I can achieve what I want. However, Id like to be able to use a colormap so that I dont have to manually create color arrays everytime that I want to change my colorscheme. So, how can I force contour() to spread my levels across THE WHOLE spectrum of a colormap? Please help, Thanks, P.Romero _________________________________________________________________ Express your personality in color! Preview and select themes for Hotmail®. http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=TXT_MSGTX_WL_HM_express_032009#colortheme |
|
From: Pablo R. <rom...@ho...> - 2009-03-15 04:51:03
|
Eric, version matplotlib-0.98.5.2 running on fedora 9, i386. the pause was significant, up to about 30 seconds to a minute. HOWEVER, your delete_masked_points() solution worked incredibly, reducing the amount of vertices by a giant amount (in one case, from 6,000+ to 180 vertices), and the rendering time to almost nothing. Im still not clear on how the 'delete_masked_points()' or 'X.ravel()' functions work; I need to read up on these. One thing that *IS* clear is that my previous X,Y arrays were 2D arrays, and the resulting x,y arrays after using your solution are only 1D arrays. The new 1D X,Y arrays do work with the quiver() function, which I dont understand, since I was under the impression that these X,Y arrays needed to be created using a method like this: m=basemap(...) X,Y=m(*numpy.meshgrid(lat_points_array,lon_points_array)) and that this should, in theory, create the 2D X,Y arrays that quiver requires, correct? am I missing something here? the new 1D arrays are more than twice the size than the original arrays as reported by 'len()', but they are obviously much smaller due to the fact that they are 1D arrays. Anyway, thanks again for the help, P.Romero ---------------------------------------- > Date: Sat, 14 Mar 2009 17:57:27 -1000 > From: ef...@ha... > Subject: Re: [Matplotlib-users] problem with (poor) quiver performance & X, Y, U, V arrays > To: rom...@ho... > CC: mat...@li... > > Pablo Romero wrote: >> Im experiencing very poor performance when using the 'quiver' function over relatively large grids. >> Im using quiver to plot wind 'u,v' data over a lat/lon grid using basemap. >> >> quiver performs decently over small lat/lon ranges, such as a bounding box of lat(0-30),lon(-120- -100), but when I try to plot larger areas (i.e. the entire globe), quiver causes a very large pause. through some debugging of quiver.py, I narrowed down the performance lag to the "set_vertices" function call within the "draw()" function in the quiver class. as a test, I printed 'len(vert)' in order to see the vertice array length that was causing problems...it seems that Im getting vertice counts in the high thousands, and quiver seems to struggle with this. >> >> should quiver be able to easily handle such a large amount of vertices? > > What version of matplotlib are you using, and on what platform? > > How long is the pause, and for how many vectors? > > I presume you are referring to the set_verts() method which is inherited > from collections.PolyCollection. It is using a list comprehension to > loop over the vectors, making a path for each, so I would not expect it > to be particularly quick; but whether it is unreasonable, or whether it > can be sped up reasonably easily, I don't know. > >> >> >> A secondary question: >> the method Im using to create my X,Y,U,V arrays is creating 'larger-than-necessary' X,Y arrays; i.e., Im not plotting the U,V vectors at each lat&lon point, Im 'skipping' over 'every-nth-point', so my U,V arrays are equal in size to my X,Y arrays, but have many empty elements. >> >> Unfortunately, the array data is being imported from an external program (named 'GRADS'), so I cannot prevent these arrays from being 'oversized' upon their creation. >> >> example: >> for a (10 degree lat)x(10 degree lon) area, I might have arrays like this: >> >> X='[0,0.5,1.0,1.5,2.0,2.5,...10.0],[0,0.5,...10],...[0.0,0.5,...10.0]' >> Y='[0,0.5,1.0,1.5,2.0,2.5,...10.0],[0,0.5,...10],...[0.0,0.5,...10.0]' >> U='[--,--,0.40,--,--,0.15,...0.30],[--,--,0.25,--,--...,0.12],...[--,--,0.50,...10.0]' >> V='[--,--,0.30,--,--,0.25,...0.40],[--,--,0.25,--,--...,0.12],...[--,--,0.50,...10.0]' >> >> these values are completely inaccurate and are meant just to illustrate the fact that I have many 'skipped' values in my U,V arrays, and I have oversized X,Y arrays that cover the 10x10 lat/lon grid... >> >> So, what I want to do is create NEW X,Y,U,V arrays or remove elements from these existing X,Y,U,V arrays, so that: >> 1) only valid, "non-empty" values will exist in my U,V arrays..and >> 2) the only values that exist in X,Y are those that correspond to valid points in the U,V arrays... >> >> Im not very experienced with python/matplotlib, so I dont know what would be the best way to iterate over these 4 arrays and remove the empty invalid elements (or copy the valid elements into new arrays). How can I go about shortening these arrays? >> > > Assuming your X, Y, U, V are all masked arrays or ndarrays of the same > shape, you can use > > from matplotlib.cbook import delete_masked_points > > x,y,u,v = delete_masked_points(X.ravel(), Y.ravel(). U.ravel(), V.ravel()) > > The Barbs class in quiver.py uses this function; Quiver could be > modified to use it, with the loss of a bit of functionality that I > suspect no one is using anyway. > > All the .ravel() method calls are needed only if the arrays are 2-D or > higher. > > >> Im hoping that with less points in my X,Y arrays, that quiver will perform faster since it isnt wasting time trying to process X,Y points where U,V are empty). >> > > Let us know how much difference it makes, and tell us what the initial > and modified number of vectors is. > > Eric _________________________________________________________________ Windows Live™ Groups: Create an online spot for your favorite groups to meet. http://windowslive.com/online/groups?ocid=TXT_TAGLM_WL_groups_032009 |
|
From: Eric F. <ef...@ha...> - 2009-03-15 03:57:41
|
Pablo Romero wrote: > Im experiencing very poor performance when using the 'quiver' function over relatively large grids. > Im using quiver to plot wind 'u,v' data over a lat/lon grid using basemap. > > quiver performs decently over small lat/lon ranges, such as a bounding box of lat(0-30),lon(-120- -100), but when I try to plot larger areas (i.e. the entire globe), quiver causes a very large pause. through some debugging of quiver.py, I narrowed down the performance lag to the "set_vertices" function call within the "draw()" function in the quiver class. as a test, I printed 'len(vert)' in order to see the vertice array length that was causing problems...it seems that Im getting vertice counts in the high thousands, and quiver seems to struggle with this. > > should quiver be able to easily handle such a large amount of vertices? What version of matplotlib are you using, and on what platform? How long is the pause, and for how many vectors? I presume you are referring to the set_verts() method which is inherited from collections.PolyCollection. It is using a list comprehension to loop over the vectors, making a path for each, so I would not expect it to be particularly quick; but whether it is unreasonable, or whether it can be sped up reasonably easily, I don't know. > > > A secondary question: > the method Im using to create my X,Y,U,V arrays is creating 'larger-than-necessary' X,Y arrays; i.e., Im not plotting the U,V vectors at each lat&lon point, Im 'skipping' over 'every-nth-point', so my U,V arrays are equal in size to my X,Y arrays, but have many empty elements. > > Unfortunately, the array data is being imported from an external program (named 'GRADS'), so I cannot prevent these arrays from being 'oversized' upon their creation. > > example: > for a (10 degree lat)x(10 degree lon) area, I might have arrays like this: > > X='[0,0.5,1.0,1.5,2.0,2.5,...10.0],[0,0.5,...10],...[0.0,0.5,...10.0]' > Y='[0,0.5,1.0,1.5,2.0,2.5,...10.0],[0,0.5,...10],...[0.0,0.5,...10.0]' > U='[--,--,0.40,--,--,0.15,...0.30],[--,--,0.25,--,--...,0.12],...[--,--,0.50,...10.0]' > V='[--,--,0.30,--,--,0.25,...0.40],[--,--,0.25,--,--...,0.12],...[--,--,0.50,...10.0]' > > these values are completely inaccurate and are meant just to illustrate the fact that I have many 'skipped' values in my U,V arrays, and I have oversized X,Y arrays that cover the 10x10 lat/lon grid... > > So, what I want to do is create NEW X,Y,U,V arrays or remove elements from these existing X,Y,U,V arrays, so that: > 1) only valid, "non-empty" values will exist in my U,V arrays..and > 2) the only values that exist in X,Y are those that correspond to valid points in the U,V arrays... > > Im not very experienced with python/matplotlib, so I dont know what would be the best way to iterate over these 4 arrays and remove the empty invalid elements (or copy the valid elements into new arrays). How can I go about shortening these arrays? > Assuming your X, Y, U, V are all masked arrays or ndarrays of the same shape, you can use from matplotlib.cbook import delete_masked_points x,y,u,v = delete_masked_points(X.ravel(), Y.ravel(). U.ravel(), V.ravel()) The Barbs class in quiver.py uses this function; Quiver could be modified to use it, with the loss of a bit of functionality that I suspect no one is using anyway. All the .ravel() method calls are needed only if the arrays are 2-D or higher. > Im hoping that with less points in my X,Y arrays, that quiver will perform faster since it isnt wasting time trying to process X,Y points where U,V are empty). > Let us know how much difference it makes, and tell us what the initial and modified number of vectors is. Eric |
|
From: Eric F. <ef...@ha...> - 2009-03-15 03:33:52
|
per freem wrote: > hi all, > > i'm trying to generate a very simple plot, where only the left y axis > and the bottom x axis are present. i.e. there is no top x axis or right > y axis... this is the default for many plotting packages. in matlab, one > can do this as follows: > > >> x = rand(1,100); > >> hist(x) > >> set(gca, 'Box', 'off', 'LineWidth', 1); > > so the set(gca, 'Box', 'off'...) command does the job. what's the > analogous matplotlib command? i would like to do this preferably without > any external packages. There is no analogous command, despite many requests such as yours. Recipes for getting this effect have been posted to the list, though. See also http://matplotlib.sourceforge.net/examples/pylab_examples/manual_axis.html. Making axes more flexible, to handle your case and others such as axes crossing in the middle of a figure, is on the wish list, but turns out to require quite a bit of work--more than one might expect. Eric |
|
From: Pablo R. <rom...@ho...> - 2009-03-15 03:29:37
|
Im experiencing very poor performance when using the 'quiver' function over relatively large grids. Im using quiver to plot wind 'u,v' data over a lat/lon grid using basemap. quiver performs decently over small lat/lon ranges, such as a bounding box of lat(0-30),lon(-120- -100), but when I try to plot larger areas (i.e. the entire globe), quiver causes a very large pause. through some debugging of quiver.py, I narrowed down the performance lag to the "set_vertices" function call within the "draw()" function in the quiver class. as a test, I printed 'len(vert)' in order to see the vertice array length that was causing problems...it seems that Im getting vertice counts in the high thousands, and quiver seems to struggle with this. should quiver be able to easily handle such a large amount of vertices? A secondary question: the method Im using to create my X,Y,U,V arrays is creating 'larger-than-necessary' X,Y arrays; i.e., Im not plotting the U,V vectors at each lat&lon point, Im 'skipping' over 'every-nth-point', so my U,V arrays are equal in size to my X,Y arrays, but have many empty elements. Unfortunately, the array data is being imported from an external program (named 'GRADS'), so I cannot prevent these arrays from being 'oversized' upon their creation. example: for a (10 degree lat)x(10 degree lon) area, I might have arrays like this: X='[0,0.5,1.0,1.5,2.0,2.5,...10.0],[0,0.5,...10],...[0.0,0.5,...10.0]' Y='[0,0.5,1.0,1.5,2.0,2.5,...10.0],[0,0.5,...10],...[0.0,0.5,...10.0]' U='[--,--,0.40,--,--,0.15,...0.30],[--,--,0.25,--,--...,0.12],...[--,--,0.50,...10.0]' V='[--,--,0.30,--,--,0.25,...0.40],[--,--,0.25,--,--...,0.12],...[--,--,0.50,...10.0]' these values are completely inaccurate and are meant just to illustrate the fact that I have many 'skipped' values in my U,V arrays, and I have oversized X,Y arrays that cover the 10x10 lat/lon grid... So, what I want to do is create NEW X,Y,U,V arrays or remove elements from these existing X,Y,U,V arrays, so that: 1) only valid, "non-empty" values will exist in my U,V arrays..and 2) the only values that exist in X,Y are those that correspond to valid points in the U,V arrays... Im not very experienced with python/matplotlib, so I dont know what would be the best way to iterate over these 4 arrays and remove the empty invalid elements (or copy the valid elements into new arrays). How can I go about shortening these arrays? Im hoping that with less points in my X,Y arrays, that quiver will perform faster since it isnt wasting time trying to process X,Y points where U,V are empty). Please help, P.Romero _________________________________________________________________ Hotmail® is up to 70% faster. Now good news travels really fast. http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_70faster_032009 |