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
(19) |
2
(28) |
3
(8) |
4
(15) |
5
(20) |
6
(23) |
7
(12) |
8
(11) |
9
(13) |
10
(4) |
11
(9) |
12
(34) |
13
(33) |
14
(24) |
15
(15) |
16
(12) |
17
(8) |
18
(5) |
19
(5) |
20
(6) |
21
(10) |
22
(9) |
23
(18) |
24
(10) |
25
(7) |
26
(13) |
27
(18) |
28
(29) |
29
(4) |
30
(5) |
31
(2) |
Xavier Gnata wrote: > Hi, > > Imagine you have something like: > > from pylab import * > t = arange(0.0, 2.0, 0.01) > s = sin(2*pi*t) > ax = subplot(111) > ax.plot(t, s) > > That's fine but now I would like to plot the negative parts of the curve > in red and the positive one in green. > Is there a nice pylab oriented way to do that? Some kind of "conditional > formating"? Not built in, but you can do it easily with masked arrays. See http://matplotlib.sourceforge.net/examples/pylab_examples/masked_demo.html It is not exactly what you want, but close: sneg = np.ma.masked_greater_equal(s, 0) spos = np.ma.masked_less_equal(s, 0) ax.plot(t, spos, 'g') ax.plot(t, sneg, 'r') What this does not do is ensure that there is no gap where the line crosses zero. For that, you would need to ensure that your sampling of s(t) includes the zeros. Eric > > Xavier > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Steve Westenbroek wrote: > Hi Jeff, > > I apologize in advance for contacting you directly, however, I've been > Googling and RTFM-ing to no avail! > > If you have time and/or inclination, I have two questions for you > regarding the Basemap module under Matplotlib. > > 1) I've been struggling to use "readshapefile" to load a simple polyline > shapefile. I'm currently running the Enthought Python Distribution > v5.1.0 on Windows XP. I stumbled onto an archived email message from > you describing how one does a "python setup.py install" from within > the Thuban source directory. I can verify that the pytest.py script > works following installation. However, I cannot get Python to > recognize "readshapefile" as a valid method. I'm sure there is a > simple solution to this, but it is just out of my reach. Any ideas? > Steve: You have to create a basemap class instance, then call the readshape file method. All the necessary dependencies are included, you don't have to install anything else. Try running the fillstates.py demo, and if that works, everything is fine. > 2) It does not appear that one can simply pass through the Proj4 > string when invoking "Basemap"? Is this true? I have some whacky > (i.e. project-specific) projection parameters that I'd love to simply > feed into "Basemap", but it doesn't appear to be a possibility. If I > am correct, do you have a sense for how difficult it would be to > modify Basemap to accept Proj4 strings? It's impossible, because a) Basemap doesn't support all the possible proj4 projections, and b) not all the info Basemap needs can be specified in a proj4 string. Have you seen the documentation at http://matplotlib.sourceforge.net/basemap/doc/html/ ? -Jeff > > Thanks in advance! It seems that I am tantalizingly close to making > this work for my problem. > > Cheers, > > - Steve >
John [H2O] wrote: > > Jeff Whitaker wrote: >> >> John: I don't have time to look at your code right now, but let me just >> make some general comments about plotting images on maps. If you want >> to use imshow, the data your are plotting must coincide exactly with >> your map plot area. So, for example if you want to plot a global >> lat/lon grid on a north polar stereographic projection, you have to >> interpolate to a rectangular grid in projection coordinates that fits in >> the map region. However, in practice I find it's almost never worth >> doing this. You can plot the data in the native coordinates on almost >> any map projection region using pcolormesh or contourf, Just calculate >> the x,y values of the of the data grid, and pass those values along with >> the data to either one of those methods. Is there any particular reason >> you want to use imshow, instead of pcolormesh or contourf? >> >> -Jeff >> >> > > Jeff, > > I started using pcolormesh, but ran into the problem that I really required > a log scale color map for the plotting. As I recall, this could only be done > with imshow - but perhaps that has changed? Regardless, I've done some All the "mappables" like images, pcolor-type plots (including pcolormesh), scatter, and collections can be created with a colormap and a norm. Using norm=LogNorm() gives you a log scale for color. See http://matplotlib.sourceforge.net/examples/pylab_examples/pcolor_log.html?highlight=pcolor_log > further testing. It seems I have the following problems with it: > > 1) It is much more 'coarse' in the coloring, imshow offers a finer/smoother > looking gradient. Imshow by default interpolates the colors; the pcolor* functions/methods do not. Eric > > 2) The bigger problem occurs when plotting in npstere, which I use quite > often. Maybe I have to add a wrap around, but as it is, I get a 'seam' at > the -180/180 meridian. > > 3) At the pole, there is a empty spot, creating a hole in my plots. This I > can't work with... :s > > Thanks again for your input. > > -john > >
Hi, Imagine you have something like: from pylab import * t = arange(0.0, 2.0, 0.01) s = sin(2*pi*t) ax = subplot(111) ax.plot(t, s) That's fine but now I would like to plot the negative parts of the curve in red and the positive one in green. Is there a nice pylab oriented way to do that? Some kind of "conditional formating"? Xavier
Leo Trottier wrote: > Hi Michael, > > I suppose I'm a bit confused -- I thought that jpeglib, part of which > is implemented by PIL (??) Other way around. PIL uses jpeglib to read JPEG files. > could process compressed images without > representing decompressing them to a dense raster-image matrix > (http://en.wikipedia.org/wiki/Jpeglib). However, PIL does not use make use of such capabilities. It just reads in the data into uncompressed memory just like it does with any other image format. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
Hi Michael, I suppose I'm a bit confused -- I thought that jpeglib, part of which is implemented by PIL (??) could process compressed images without representing decompressing them to a dense raster-image matrix (http://en.wikipedia.org/wiki/Jpeglib). That said, I tried to do some PIL things, and as soon as I converted an image (or something similar) the memory taken up suggested that the image was represented completely and uncompressed (memory was more or less evenly split between virtual and real memory). So, I guess what remains are the problems with iPython. My MATLAB-loving friend has stuck his nose up because of the memory-leaky interactive prompt, claiming that MATLAB has no such problems ... Thanks for your help, in any case. Leo On Mon, Oct 5, 2009 at 5:47 AM, Michael Droettboom <md...@st...> wrote: > For some reason, my earlier reply didn't seem to make it to the mailing > list. Here it is in its entirety: > > """ > If you assign each figure to a new number, it will keep all of those figures > around in memory (because pyplot thinks you may want to use it again.) The > best route is to call close('all') or fig.close() with each loop iteration. > > 40MB per image doesn't sound way out of reason to me. How big are your > images? > """ > > On 10/05/2009 03:46 AM, Leo Trottier wrote: > > Hi, > > I think I've figured out what's going on. It's a combination of things: > > 1) iPython is ignorant of the problems associated with caching massive data > output > 2) iPython doesn't seem to have a good way to clear data from memory > reliably (https://bugs.launchpad.net/ipython/+bug/412350) > > iPython is designed for interactive use, and stores a lot of values so they > can be conveniently reused later. For long running "batch" scripts, you can > use "regular" Python, or run the code in iPython such that it isn't > displayed at the console (by using "import" or "%run"). Bug 2) may help > looks like it would still require some manual intervention to be usefull. > You're still using a tool designed for fine-grained interactive use (eg. a > pen) where one designed for automation may be more appropriate (eg. a laser > printer) :) > > 3) matplotlib/Python seems to be insufficiently aggressive in its garbage > collection (??) > > Is that still true after forcibly closing the figures on each loop iteration > as I suggested? Many hours have been spent squashing memory leaks in > matplotlib, and I am not aware of any in at least 0.98 and later (other than > some unavoidable small leaks in certain GUI backends). Do you have a > standalone example that illustrates this on a recent version of matplotlib? > > 4) For obvious reasons, JPGs are much bigger when stored as arrays (though > they still seem to take up more memory than they should) > > It's pretty easy to estimate the memory requirements for an image. If the > image is true-color (by this, I mean not color-mapped), you'll need > 4-bytes-per-pixel for the original image, plus a cached scaled copy (the > size of which depends on the output dpi), again with 4 bytes per pixel. For > color-mapped images, you'll have 4-byte floats for each pixel, 4-byte rgba > for the color-mapped image, and again a cached scaled copy of that. Not > knowing the size of your input images, it's impossible to say if 40MB per > image is way too big or not, but it's not unheard of by any means. > > Problems 1-3 seem problematic enough that they will get fixed eventually. > > ... but (4) is a design issue. Assuming it's possible, it looks like there > could be benefits to making an array-like wrapper around PIL image objects > (perhaps similar in principle to a sparse matrix). Given PIL.ImageMath, > ImagePath, etc., it seems actually fairly doable. Wouldn't something like > this be of major benefit to people using SciPy for anything image-related? > > Are you suggesting decompressing the JPEG on-the-fly with each redraw? I'm > not certain that would be fast enough for interactive use. It may be worth > experimenting with, but it would require a lot of changes to how matplotlib > works. It's also very tricky to get right -- I'm not aware of any image > processing applications that don't ultimately store a dense matrix of > uncompressed image data in memory, except for something like compressed > OpenGL textures on a graphics card. PIL certainly doesn't retain the > compressed JPEG in memory. So, I'm not sure the cost/benefit tradeoff is > right here -- the problems it solves can be solved much more easily without > sacrificing speed in other ways. That is, if the image data is simply too > large, it can be scaled before feeding it to imshow(). And generating > multiple figures in batch is not a problem if the figure is explicitly > closed. > > Hope this helps. I would like to get to the bottom of any memory leaks, so > if you can provide a standalone script that leaks, despite calling > figure.close() in each iteration, please let me know. > > Cheers, > Mike > > Leo > > On Fri, Oct 2, 2009 at 7:45 AM, Michael Droettboom <md...@st...> wrote: >> >> If you assign each figure to a new number, it will keep all of those >> figures around in memory (because pyplot thinks you may want to use it >> again.) The best route is to call close('all') or fig.close() with each >> loop iteration. >> >> 40MB per image doesn't sound way out of reason to me. How big are your >> images? >> >> Mike >> >> On 10/01/2009 10:25 PM, Leo Trottier wrote: >> >> I have a friend who's having strange memory issues when opening and >> displaying images (using Matplotlib). >> Here's what he says: >> ####################################### >> >> pylab seems really inefficient: Opening a few images and displaying them >> eats up tons of memory, and the memory doesn't get freed. >> >> Starting python, and run >> >> In [5]: from glob import *; >> >> In [6]: from pylab import * >> >> python has 33MB of memory. >> >> >> Run >> >> In [7]: i = 1 >> >> In [8]: for imname in glob("*.JPG"): >> ...: im = imread(imname) >> ...: figure(i); i = i+1 >> ...: imshow(im) >> ...: >> >> This opens 10 figures and displays them. Python takes 480MB of memory. >> This is crazy, for 10 images -- 40+MB of memory for each! >> >> In [14]: close("all") >> >> In [15]: i = 1 >> >> In [16]: for imname in glob("*.JPG"): >> im = imread(imname) >> figure(i); i = i+1 >> imshow(im) >> ....: >> ....: >> >> This closes all figures and opens them again. Python takes up 837MB of >> memory. >> >> and so on... Something is really wrong with memory management. >> >> ##### System info: ############## >> (using macosx backend) >> 2.4GHz MacBook Pro Intel Core 2 Duo >> >> 4GB 667MHz DDR2 SDRAM >> In [5]: sys.version >> Out[5]: '2.6.2 (r262:71600, Oct 1 2009, 16:44:23) \n[GCC 4.2.1 (Apple >> Inc. build 5646)]' >> >> In [6]: numpy.__version__ >> Out[6]: '1.3.0' >> >> In [7]: matplotlib.__version__ >> Out[7]: '0.99.1.1' >> >> In [8]: scipy.__version__ >> Out[8]: '0.7.1' >> >> In [9]: >> >> ________________________________ >> >> ------------------------------------------------------------------------------ >> Come build with us! The BlackBerry® Developer Conference in SF, CA >> is the only developer event you need to attend this year. Jumpstart your >> developing skills, take BlackBerry mobile applications to market and stay >> ahead of the curve. Join us from November 9-12, 2009. Register >> now! >> http://p.sf.net/sfu/devconf >> >> ________________________________ >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > >
Jeff Whitaker wrote: > > > John: I don't have time to look at your code right now, but let me just > make some general comments about plotting images on maps. If you want > to use imshow, the data your are plotting must coincide exactly with > your map plot area. So, for example if you want to plot a global > lat/lon grid on a north polar stereographic projection, you have to > interpolate to a rectangular grid in projection coordinates that fits in > the map region. However, in practice I find it's almost never worth > doing this. You can plot the data in the native coordinates on almost > any map projection region using pcolormesh or contourf, Just calculate > the x,y values of the of the data grid, and pass those values along with > the data to either one of those methods. Is there any particular reason > you want to use imshow, instead of pcolormesh or contourf? > > -Jeff > > Jeff, I started using pcolormesh, but ran into the problem that I really required a log scale color map for the plotting. As I recall, this could only be done with imshow - but perhaps that has changed? Regardless, I've done some further testing. It seems I have the following problems with it: 1) It is much more 'coarse' in the coloring, imshow offers a finer/smoother looking gradient. 2) The bigger problem occurs when plotting in npstere, which I use quite often. Maybe I have to add a wrap around, but as it is, I get a 'seam' at the -180/180 meridian. 3) At the pole, there is a empty spot, creating a hole in my plots. This I can't work with... :s Thanks again for your input. -john -- View this message in context: http://www.nabble.com/basemap%2C-transform_scalar-question-tp25649437p25847646.html Sent from the matplotlib - users mailing list archive at Nabble.com.
On Sun, Oct 11, 2009 at 9:07 AM, per freem <per...@gm...> wrote: > hi all, > > i am trying to share both an axis label (but not the entire axis) and > a figure legend across a set of subplots. that is, i'd like to have a > figure where there is a major enlarged ylabel that is meant to label > the entire row of subplots and a main figure legend, rather than > individual legends inside subplots. what i have right now is: > > import matplotlib.pyplot as plt > from mpl_toolkits.axes_grid.axislines import SubplotZero > fig = plt.figure() > ax = SubplotZero(fig, 3, 1, 1) > ax1 = fig.add_subplot(ax) > ax.axis["xzero"].set_visible(True) > plt.plot([1,2,3], label="line a", c='r') > plt.plot([1.2, 2.4, 3.01], label="line b", c='b') > ax = SubplotZero(fig, 3, 1, 2) > ax2 = fig.add_subplot(ax) > plt.plot([1,2,3], label="line a", c='r') > plt.plot([1.2, 2.4, 3.01], label="line b", c='b') > ax = SubplotZero(fig, 3, 1, 3) > ax3 = fig.add_subplot(ax) > plt.plot([1,2,3], label="line a", c='r') > plt.plot([1.2, 2.01, 3.01], label="line b", c='b') > plt.figlegend([ax1.lines[0], ax1.lines[1]], ["line a", "line b"], 'upper > right') > > two quick questions about this: first, how can i create a single > ylabel for the figure? i still want each subplot to have its own > yticks and ytick labels but i just want a main label, since the > quantity plotted on each y axis is the same. > I had asked a similar question at http://www.nabble.com/Common-ylabel-for-subplots-td22416664.html#a22416664 which I had managed to have a common y-label following the suggestions given on that thread. However I haven't gone further to create a common legend. > > finally, plt.figlegend does display a main legend for the figure, like > i intended, but i was hoping someone can explain how ax1.lines gets > set. i was expecting ax1.lines to have 2 elements in it, one for each > line plotted, but it has 4. why is that? right now i simply used > lines[0] and lines[1] to create the labels for only the plotted > lines... is there a better way of doing this? > > thanks. > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Gökhan
hi all, i am trying to share both an axis label (but not the entire axis) and a figure legend across a set of subplots. that is, i'd like to have a figure where there is a major enlarged ylabel that is meant to label the entire row of subplots and a main figure legend, rather than individual legends inside subplots. what i have right now is: import matplotlib.pyplot as plt from mpl_toolkits.axes_grid.axislines import SubplotZero fig = plt.figure() ax = SubplotZero(fig, 3, 1, 1) ax1 = fig.add_subplot(ax) ax.axis["xzero"].set_visible(True) plt.plot([1,2,3], label="line a", c='r') plt.plot([1.2, 2.4, 3.01], label="line b", c='b') ax = SubplotZero(fig, 3, 1, 2) ax2 = fig.add_subplot(ax) plt.plot([1,2,3], label="line a", c='r') plt.plot([1.2, 2.4, 3.01], label="line b", c='b') ax = SubplotZero(fig, 3, 1, 3) ax3 = fig.add_subplot(ax) plt.plot([1,2,3], label="line a", c='r') plt.plot([1.2, 2.01, 3.01], label="line b", c='b') plt.figlegend([ax1.lines[0], ax1.lines[1]], ["line a", "line b"], 'upper right') two quick questions about this: first, how can i create a single ylabel for the figure? i still want each subplot to have its own yticks and ytick labels but i just want a main label, since the quantity plotted on each y axis is the same. finally, plt.figlegend does display a main legend for the figure, like i intended, but i was hoping someone can explain how ax1.lines gets set. i was expecting ax1.lines to have 2 elements in it, one for each line plotted, but it has 4. why is that? right now i simply used lines[0] and lines[1] to create the labels for only the plotted lines... is there a better way of doing this? thanks.