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
(2) |
2
(5) |
3
(8) |
4
(6) |
5
(9) |
6
(7) |
7
(6) |
8
(10) |
9
(27) |
10
(7) |
11
(22) |
12
(13) |
13
(7) |
14
(4) |
15
(12) |
16
(32) |
17
(26) |
18
(14) |
19
(1) |
20
(11) |
21
(6) |
22
(11) |
23
(17) |
24
(18) |
25
(28) |
26
(11) |
27
(6) |
28
(1) |
29
(10) |
30
(12) |
|
|
|
|
Yes, I did indeed. Is it sufficient replace the matplotlib directory under the scisoft/ with the one available from the site (0.98.0) to update it? I also noticed that the available Fink package is also the matplotlib-0.91.0. Thanks, Nino Manuel Metz wrote: > Antonino Cucchiara wrote: > >> Hello list, >> I am trying to run the "histogram_demo_extended.py" on my mac 10.5. >> I installed matplotlib through the scisoft package. >> The normal hist command works fine but when I tried to use "align" or >> "histtype" keyward I get this kind of error: >> >> [Macintosh-2:~/optional/examples/pylab_examples] nino% >> ./histogram_demo_extended.py >> Traceback (most recent call last): >> File "./histogram_demo_extended.py", line 15, in <module> >> n, bins, patches = P.hist(x, 50, normed=1, histtype='stepfilled') >> File >> "/scisoft/i386/library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/pyplot.py", >> line 1633, in hist >> ret = gca().hist(*args, **kwargs) >> File >> "/scisoft/i386/library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/axes.py", >> line 5064, in hist >> p.update(kwargs) >> File >> "/scisoft/i386/library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/artist.py", >> line 394, in update >> raise AttributeError('Unknown property %s'%k) >> AttributeError: Unknown property histtype >> >> Can someone give me any advice? >> Thanks a lot in advance. >> >> nino >> >> > > I guess that you installed matplotlib v0.91.x via scisoft !? The keyword > "histtype" was introduced in 0.98.0, so you can't use it on your system. > > Manuel > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Antonino Cucchiara PhD candidate Department of Astronomy&Astrophysics Penn State University website: www.astro.psu.edu/~cucchiara/
Antonino Cucchiara wrote: > Hello list, > I am trying to run the "histogram_demo_extended.py" on my mac 10.5. > I installed matplotlib through the scisoft package. > The normal hist command works fine but when I tried to use "align" or > "histtype" keyward I get this kind of error: > > [Macintosh-2:~/optional/examples/pylab_examples] nino% > ./histogram_demo_extended.py > Traceback (most recent call last): > File "./histogram_demo_extended.py", line 15, in <module> > n, bins, patches = P.hist(x, 50, normed=1, histtype='stepfilled') > File > "/scisoft/i386/library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/pyplot.py", > line 1633, in hist > ret = gca().hist(*args, **kwargs) > File > "/scisoft/i386/library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/axes.py", > line 5064, in hist > p.update(kwargs) > File > "/scisoft/i386/library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/artist.py", > line 394, in update > raise AttributeError('Unknown property %s'%k) > AttributeError: Unknown property histtype > > Can someone give me any advice? > Thanks a lot in advance. > > nino > I guess that you installed matplotlib v0.91.x via scisoft !? The keyword "histtype" was introduced in 0.98.0, so you can't use it on your system. Manuel
thanks Johan, I posted to scipy because of histogram2d being in numpy, sorry about that. Now the stupid question, why can't imshow directly parse histogram2d, without the transitory extent object? Anyway, I am happy that there is a simple way as explained below! thanks again, Johann John Hunter wrote: > On Fri, Sep 5, 2008 at 10:36 AM, Johann Cohen-Tanugi > <co...@sl...> wrote: > >> hi, I hope someone can quickly point me to some doc. >> I can do imshow(histogram2d(x,y)[0]) but then I miss the x and y binning >> correct labels. >> If I do imshow(histogram2d(x,y)) I get: >> ERROR: An unexpected error occurred while tokenizing input >> The following traceback may be corrupted or invalid >> The error message is: ('EOF in multi-line statement', (115, 0)) >> > > matplotlib questions are best addressed to the matplotlib-users mailing list at > > http://lists.sourceforge.net/mailman/listinfo/matplotlib-users > > histogram2d returns H, xedges and yedges. The first argument should > be passed to imshow, and the second two can be used to get the extents > > In [26]: x, y = np.random.randn(2, 100000) > > In [27]: H, xedges, yedges = np.histogram2d(x, y, bins=50) > > In [28]: extent = [xedges[0], xedges[-1], yedges[0], yedges[-1]] > > In [29]: imshow(H, extent=extent) > Out[29]: <matplotlib.image.AxesImage object at 0x9377bcc> > > I > _______________________________________________ > SciPy-user mailing list > Sci...@sc... > http://projects.scipy.org/mailman/listinfo/scipy-user >
I finally committed this fix. -- Jouni K. Seppänen http://www.iki.fi/jks
Hello list, I am trying to run the "histogram_demo_extended.py" on my mac 10.5. I installed matplotlib through the scisoft package. The normal hist command works fine but when I tried to use "align" or "histtype" keyward I get this kind of error: [Macintosh-2:~/optional/examples/pylab_examples] nino% ./histogram_demo_extended.py Traceback (most recent call last): File "./histogram_demo_extended.py", line 15, in <module> n, bins, patches = P.hist(x, 50, normed=1, histtype='stepfilled') File "/scisoft/i386/library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/pyplot.py", line 1633, in hist ret = gca().hist(*args, **kwargs) File "/scisoft/i386/library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/axes.py", line 5064, in hist p.update(kwargs) File "/scisoft/i386/library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/artist.py", line 394, in update raise AttributeError('Unknown property %s'%k) AttributeError: Unknown property histtype Can someone give me any advice? Thanks a lot in advance. nino -- Antonino Cucchiara PhD candidate Department of Astronomy&Astrophysics Penn State University website: www.astro.psu.edu/~cucchiara/
Hi, How can I plot numbers on the x and y axes in scientific notation? I have very large values on the y axis which I'd like to show as 1e9 and not 1 followed by 9 zeros.
Hi, Thanks a lot to all of you for your help. This looks very promising. I will test it on Monday. Regards, Marjolaine. >>> Michael Droettboom <md...@st...> 09/05/08 7:54 PM >>> You could do something like: def bitget(value, bit_number): return (value & (1 << bit_number)) != 0 which will return True or False for the given bit number, and this function works on numpy arrays. (Bits are numbered base-0 -- I don't know if that matches matlab). Hope that helps, Mike Marjolaine Rouault wrote: > Hi, > > I was wondering if python has the equivalent of the matlab bitget.m function. > > I have a large 2 dimensional variable of type uint32 which I must convert to binaries and then find if bit 23 of the binary for each point is 0 or 1. The matlab bitget function is ideal for that but I can't find much in python. The only thing I found was binary_repr which converts to a sting and can only be used for 1 point at a time. > > Any suggestions? > > Thanks, Marjolaine. > > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support.
dmitrey wrote: > Eric Firing wrote: >> dmitrey wrote: >>> hi all, >>> matplotlib says it's similar to MATLAB's plot tool, however, using >>> plot(..., 'p') plots pentagram instead of star. It makes my (Python >>> scikits.openopt) graphic output of numerical convergence look uglier >>> than MATLAB version. >>> >>> So is plotting a star intended to be ever implemented? >> Dmitrey, >> >> It was easy, so I added a 5-point star to the set of available markers >> in svn. Use plot(..., '*'). 'p' was already taken, and '*' seems >> more mnemonic--I would never think of 'p' as indicating a star. >> >> Eric > Thank you, currently I'm using scatter (it will take a time while all > users will have the matplotlib version with '*' available). > > There is unclear parameter in scatter docstring, could you explain what > does it mean: > > *s*: > size in points^2. It is a scalar or an array of the same > length as *x* and *y*. > > so what does it mean "size in points^2"? It means the area of the circle circumscribing the marker, with that area measured in units of points squared. The strange choice of s as a measure of area instead of radius or diameter is for compatibility with Matlab. Eric > > Regards, D.
Ah, Ich verstehe now. I'll try RGBA-ing it; in the meantime, let me know if the colormapping conversion gets changed to 32 bit. Thanks again! DG --- On Sat, 9/6/08, Eric Firing <ef...@ha...> wrote: > From: Eric Firing <ef...@ha...> > Subject: Re: [Matplotlib-users] imshow size limitations? > To: d_l...@ya... > Cc: mat...@li... > Date: Saturday, September 6, 2008, 3:13 PM > David Goldsmith wrote: > > Thanks, Eric! > > > > --- On Sat, 9/6/08, Eric Firing > <ef...@ha...> wrote: > > > > -- snip OP -- > > > >> It looks to me like you simply ran out of > memory--this is > >> not an imshow > >> problem as such. Your array is about 1e8 > elements, and as > >> floats that > >> would be close to a GB--just for that array alone. > Do you > > > > Well, I anticipated that, so I do initialize the > storage for the numpy array as numpy.uint8 and have > confirmed that the data in the array returned by the > function which creates it remains numpy.uint8, so it should > "only" be ~100MB (indeed, the .na file into which > I tofile it is 85,430 KB, just as it should be for a 10800 x > 8100 array of uint8 elements). And the ax.imshow statement > doesn't (directly) cause the crash (but I don't know > that it isn't making either a float copy or an in-place > conversion of the array). So, AFAIK, right up until the > statement: > > > > canvas.print_figure('HiResHex') > > > > the data being imaged are all numpy.uint8 type. > > Yes, but it looks to me like they are still getting > color-mapped, and > this requires conversion to numpy.float. This may be a bad > aspect of > the mpl design, but it is quite deeply embedded. I suspect > the best we > could do would be to use float32 instead of float64; > certainly for color > mapping one does not need 64 bits. > > Using numpy.uint8 helps only if you are specifying RGBA > directly, > bypassing the colormapping. > > > > >> really need > >> all that resolution? > > > > Well, there's the rub: I fancy myself a fractal > "artist" and I have > > access to an HP DesignJet 500ps plotter with a maximum > resolution of > > 1200 x 600 dpi. For the size images I'm trying to > make (I'm hoping to go > > even bigger than 36" x 27", but I figured > that as a good starting point) > > even I regard _that_ resolution as too much - I was > thinking of 300 x > > 300 dpi (which is its "normal" resolution) > as certainly worthy of giving > > a try. :-) > > >> If you do, you will probably have to > >> get a much > >> more capable machine. > > > > Possible, but I was hoping to generate at least one > "proof" first to determine how hard I'd need > to try. > > > >> Otherwise, you need to knock down > >> the size of > >> that array before trying to plot or otherwise > manipulate > >> it. > > > > Forgive me, but I'd like a more detailed > explanation as to why: I > > have > > ample (~35 GB, just on my built-in disc, much more > than that on external > > discs) harddisc space - isn't there some way to > leverage that? > > I don't know enough about virtual memory > implementations--especially on > Win or Mac--to say. In practice, I suspect you would find > that as soon > as you are doing major swapping during a calculation, you > will thrash > the disk until you run out of patience. > > > >> With respect to imshow, probably you can get it to > handle > >> larger images > > > > Again, imshow doesn't appear to be the culprit > (contrary to my > > original subject line), rather it would appear to be > > canvas.print_figure. (While I'm on the subject of > canvas.print_figure, > > isn't there some way for MPL to "splash" > the image directly to the > > screen, without first having to write to a file? I > didn't ask this > > before because I did eventually want to write the > image to a file, but I > > would prefer to do so only after I've had a look > at it.) > > It is imshow in the sense that most of the action in mpl > doesn't happen > when you call imshow or plot or whatever--they just set > things up. The > real work is done in the backend when you display with > show() or write > to a file. > > > >> if you feed them in as NxMx4 numpy.uint8 RGBA > arrays--but I > >> doubt this > >> is going to be enough, or the right approach, for > your > >> present situation. > > > > Right: I don't see how that would be better than > having a single 8 > > bit > > datum at each point w/ color being determined from a > color map (which is > > how I'd prefer to do it anyway). > > The way it is better is that it avoids a major operation, > including the > generation of the double-precision array. The rgba array > can go > straight to agg. > > Eric > > > > Thanks again, > > > > DG > >> Eric > >> > >>> Platform Details: MPL 0.91.2 (sorry, I > didn't > >> realize I was running such an old version, maybe I > just need > >> to upgrade?), Python 2.5.2, Windows XP 2002 SP3, > 504MB > >> physical RAM, 1294MB VM Page size (1000MB init., > 5000MB max) > >>> Thanks! > >>> > >>> DG
David Goldsmith wrote: > Thanks, Eric! > > --- On Sat, 9/6/08, Eric Firing <ef...@ha...> wrote: > > -- snip OP -- > >> It looks to me like you simply ran out of memory--this is >> not an imshow >> problem as such. Your array is about 1e8 elements, and as >> floats that >> would be close to a GB--just for that array alone. Do you > > Well, I anticipated that, so I do initialize the storage for the numpy array as numpy.uint8 and have confirmed that the data in the array returned by the function which creates it remains numpy.uint8, so it should "only" be ~100MB (indeed, the .na file into which I tofile it is 85,430 KB, just as it should be for a 10800 x 8100 array of uint8 elements). And the ax.imshow statement doesn't (directly) cause the crash (but I don't know that it isn't making either a float copy or an in-place conversion of the array). So, AFAIK, right up until the statement: > > canvas.print_figure('HiResHex') > > the data being imaged are all numpy.uint8 type. Yes, but it looks to me like they are still getting color-mapped, and this requires conversion to numpy.float. This may be a bad aspect of the mpl design, but it is quite deeply embedded. I suspect the best we could do would be to use float32 instead of float64; certainly for color mapping one does not need 64 bits. Using numpy.uint8 helps only if you are specifying RGBA directly, bypassing the colormapping. > >> really need >> all that resolution? > > Well, there's the rub: I fancy myself a fractal "artist" and I have > access to an HP DesignJet 500ps plotter with a maximum resolution of > 1200 x 600 dpi. For the size images I'm trying to make (I'm hoping to go > even bigger than 36" x 27", but I figured that as a good starting point) > even I regard _that_ resolution as too much - I was thinking of 300 x > 300 dpi (which is its "normal" resolution) as certainly worthy of giving > a try. :-) >> If you do, you will probably have to >> get a much >> more capable machine. > > Possible, but I was hoping to generate at least one "proof" first to determine how hard I'd need to try. > >> Otherwise, you need to knock down >> the size of >> that array before trying to plot or otherwise manipulate >> it. > > Forgive me, but I'd like a more detailed explanation as to why: I > have > ample (~35 GB, just on my built-in disc, much more than that on external > discs) harddisc space - isn't there some way to leverage that? I don't know enough about virtual memory implementations--especially on Win or Mac--to say. In practice, I suspect you would find that as soon as you are doing major swapping during a calculation, you will thrash the disk until you run out of patience. >> With respect to imshow, probably you can get it to handle >> larger images > > Again, imshow doesn't appear to be the culprit (contrary to my > original subject line), rather it would appear to be > canvas.print_figure. (While I'm on the subject of canvas.print_figure, > isn't there some way for MPL to "splash" the image directly to the > screen, without first having to write to a file? I didn't ask this > before because I did eventually want to write the image to a file, but I > would prefer to do so only after I've had a look at it.) It is imshow in the sense that most of the action in mpl doesn't happen when you call imshow or plot or whatever--they just set things up. The real work is done in the backend when you display with show() or write to a file. >> if you feed them in as NxMx4 numpy.uint8 RGBA arrays--but I >> doubt this >> is going to be enough, or the right approach, for your >> present situation. > > Right: I don't see how that would be better than having a single 8 > bit > datum at each point w/ color being determined from a color map (which is > how I'd prefer to do it anyway). The way it is better is that it avoids a major operation, including the generation of the double-precision array. The rgba array can go straight to agg. Eric > Thanks again, > > DG >> Eric >> >>> Platform Details: MPL 0.91.2 (sorry, I didn't >> realize I was running such an old version, maybe I just need >> to upgrade?), Python 2.5.2, Windows XP 2002 SP3, 504MB >> physical RAM, 1294MB VM Page size (1000MB init., 5000MB max) >>> Thanks! >>> >>> DG
dmitrey wrote: > hi all, > matplotlib says it's similar to MATLAB's plot tool, however, using > plot(..., 'p') plots pentagram instead of star. It makes my (Python > scikits.openopt) graphic output of numerical convergence look uglier > than MATLAB version. > > So is plotting a star intended to be ever implemented? Dmitrey, It was easy, so I added a 5-point star to the set of available markers in svn. Use plot(..., '*'). 'p' was already taken, and '*' seems more mnemonic--I would never think of 'p' as indicating a star. Eric > Thank you in advance, Dmitrey
Thanks, Eric! --- On Sat, 9/6/08, Eric Firing <ef...@ha...> wrote: -- snip OP -- > It looks to me like you simply ran out of memory--this is > not an imshow > problem as such. Your array is about 1e8 elements, and as > floats that > would be close to a GB--just for that array alone. Do you Well, I anticipated that, so I do initialize the storage for the numpy array as numpy.uint8 and have confirmed that the data in the array returned by the function which creates it remains numpy.uint8, so it should "only" be ~100MB (indeed, the .na file into which I tofile it is 85,430 KB, just as it should be for a 10800 x 8100 array of uint8 elements). And the ax.imshow statement doesn't (directly) cause the crash (but I don't know that it isn't making either a float copy or an in-place conversion of the array). So, AFAIK, right up until the statement: canvas.print_figure('HiResHex') the data being imaged are all numpy.uint8 type. > really need > all that resolution? Well, there's the rub: I fancy myself a fractal "artist" and I have access to an HP DesignJet 500ps plotter with a maximum resolution of 1200 x 600 dpi. For the size images I'm trying to make (I'm hoping to go even bigger than 36" x 27", but I figured that as a good starting point) even I regard _that_ resolution as too much - I was thinking of 300 x 300 dpi (which is its "normal" resolution) as certainly worthy of giving a try. :-) > If you do, you will probably have to > get a much > more capable machine. Possible, but I was hoping to generate at least one "proof" first to determine how hard I'd need to try. > Otherwise, you need to knock down > the size of > that array before trying to plot or otherwise manipulate > it. Forgive me, but I'd like a more detailed explanation as to why: I have ample (~35 GB, just on my built-in disc, much more than that on external discs) harddisc space - isn't there some way to leverage that? > With respect to imshow, probably you can get it to handle > larger images Again, imshow doesn't appear to be the culprit (contrary to my original subject line), rather it would appear to be canvas.print_figure. (While I'm on the subject of canvas.print_figure, isn't there some way for MPL to "splash" the image directly to the screen, without first having to write to a file? I didn't ask this before because I did eventually want to write the image to a file, but I would prefer to do so only after I've had a look at it.) > if you feed them in as NxMx4 numpy.uint8 RGBA arrays--but I > doubt this > is going to be enough, or the right approach, for your > present situation. Right: I don't see how that would be better than having a single 8 bit datum at each point w/ color being determined from a color map (which is how I'd prefer to do it anyway). Thanks again, DG > > Eric > > > > > Platform Details: MPL 0.91.2 (sorry, I didn't > realize I was running such an old version, maybe I just need > to upgrade?), Python 2.5.2, Windows XP 2002 SP3, 504MB > physical RAM, 1294MB VM Page size (1000MB init., 5000MB max) > > > > Thanks! > > > > DG
David Goldsmith wrote: > Hi! I'm trying to display a 10800 x 8100 pixel image w/ imshow using the following code (adapted from a response to a previous post of mine): > > from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas > from matplotlib.figure import Figure > > fig = Figure(figsize=(36,27), > dpi=300, > frameon=False) > canvas = FigureCanvas(fig) > ax = fig.add_subplot(111, xticks=[], yticks=[]) > cmap = MPL.cm.get_cmap('prism_r') > ax.imshow(result, cmap=cmap) > canvas.print_figure('HiResHex') > > I get the following error report: > > Traceback (most recent call last): > File "Hex.py", line 208, in <module> > canvas.print_figure('HiResHex') > File "C:\python25\lib\site-packages\matplotlib\backend_bases.py", line 1201, i > n print_figure > self.figure.canvas.draw() > File "C:\python25\lib\site-packages\matplotlib\backends\backend_agg.py", line > 358, in draw > self.figure.draw(self.renderer) > File "C:\python25\lib\site-packages\matplotlib\figure.py", line 624, in draw > for a in self.axes: a.draw(renderer) > File "C:\python25\lib\site-packages\matplotlib\axes.py", line 1305, in draw > for im in self.images if im.get_visible()] > File "C:\python25\lib\site-packages\matplotlib\image.py", line 131, in make_im > age > x = self.to_rgba(self._A, self._alpha) > File "C:\python25\lib\site-packages\matplotlib\cm.py", line 75, in to_rgba > x = self.norm(x) > File "C:\python25\lib\site-packages\matplotlib\colors.py", line 593, in __call > __ > val = ma.asarray(value).astype(npy.float) > File "C:\python25\lib\site-packages\numpy\core\ma.py", line 1151, in astype > d = self._data.astype(tc) > MemoryError > > Is there some maximum number of pixels imshow can handle? Any other suggestions? David, It looks to me like you simply ran out of memory--this is not an imshow problem as such. Your array is about 1e8 elements, and as floats that would be close to a GB--just for that array alone. Do you really need all that resolution? If you do, you will probably have to get a much more capable machine. Otherwise, you need to knock down the size of that array before trying to plot or otherwise manipulate it. With respect to imshow, probably you can get it to handle larger images if you feed them in as NxMx4 numpy.uint8 RGBA arrays--but I doubt this is going to be enough, or the right approach, for your present situation. Eric > > Platform Details: MPL 0.91.2 (sorry, I didn't realize I was running such an old version, maybe I just need to upgrade?), Python 2.5.2, Windows XP 2002 SP3, 504MB physical RAM, 1294MB VM Page size (1000MB init., 5000MB max) > > Thanks! > > DG
Oh, forgot to mention: same code works fine on a smaller (fewer pixels) image. DG --- On Sat, 9/6/08, David Goldsmith <d_l...@ya...> wrote: > From: David Goldsmith <d_l...@ya...> > Subject: [Matplotlib-users] imshow size limitations? > To: mat...@li... > Date: Saturday, September 6, 2008, 10:46 AM > Hi! I'm trying to display a 10800 x 8100 pixel image w/ > imshow using the following code (adapted from a response to > a previous post of mine): > > from matplotlib.backends.backend_agg import FigureCanvasAgg > as FigureCanvas > from matplotlib.figure import Figure > > fig = Figure(figsize=(36,27), > dpi=300, > frameon=False) > canvas = FigureCanvas(fig) > ax = fig.add_subplot(111, xticks=[], yticks=[]) > cmap = MPL.cm.get_cmap('prism_r') > ax.imshow(result, cmap=cmap) > canvas.print_figure('HiResHex') > > I get the following error report: > > Traceback (most recent call last): > File "Hex.py", line 208, in <module> > canvas.print_figure('HiResHex') > File > "C:\python25\lib\site-packages\matplotlib\backend_bases.py", > line 1201, i > n print_figure > self.figure.canvas.draw() > File > "C:\python25\lib\site-packages\matplotlib\backends\backend_agg.py", > line > 358, in draw > self.figure.draw(self.renderer) > File > "C:\python25\lib\site-packages\matplotlib\figure.py", > line 624, in draw > for a in self.axes: a.draw(renderer) > File > "C:\python25\lib\site-packages\matplotlib\axes.py", > line 1305, in draw > for im in self.images if im.get_visible()] > File > "C:\python25\lib\site-packages\matplotlib\image.py", > line 131, in make_im > age > x = self.to_rgba(self._A, self._alpha) > File > "C:\python25\lib\site-packages\matplotlib\cm.py", > line 75, in to_rgba > x = self.norm(x) > File > "C:\python25\lib\site-packages\matplotlib\colors.py", > line 593, in __call > __ > val = ma.asarray(value).astype(npy.float) > File > "C:\python25\lib\site-packages\numpy\core\ma.py", > line 1151, in astype > d = self._data.astype(tc) > MemoryError > > Is there some maximum number of pixels imshow can handle? > Any other suggestions? > > Platform Details: MPL 0.91.2 (sorry, I didn't realize I > was running such an old version, maybe I just need to > upgrade?), Python 2.5.2, Windows XP 2002 SP3, 504MB physical > RAM, 1294MB VM Page size (1000MB init., 5000MB max) > > Thanks! > > DG > > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move > Developer's challenge > Build the coolest Linux based applications with Moblin SDK > & win great prizes > Grand prize is a trip for two to an Open Source event > anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Hi! I'm trying to display a 10800 x 8100 pixel image w/ imshow using the following code (adapted from a response to a previous post of mine): from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure fig = Figure(figsize=(36,27), dpi=300, frameon=False) canvas = FigureCanvas(fig) ax = fig.add_subplot(111, xticks=[], yticks=[]) cmap = MPL.cm.get_cmap('prism_r') ax.imshow(result, cmap=cmap) canvas.print_figure('HiResHex') I get the following error report: Traceback (most recent call last): File "Hex.py", line 208, in <module> canvas.print_figure('HiResHex') File "C:\python25\lib\site-packages\matplotlib\backend_bases.py", line 1201, i n print_figure self.figure.canvas.draw() File "C:\python25\lib\site-packages\matplotlib\backends\backend_agg.py", line 358, in draw self.figure.draw(self.renderer) File "C:\python25\lib\site-packages\matplotlib\figure.py", line 624, in draw for a in self.axes: a.draw(renderer) File "C:\python25\lib\site-packages\matplotlib\axes.py", line 1305, in draw for im in self.images if im.get_visible()] File "C:\python25\lib\site-packages\matplotlib\image.py", line 131, in make_im age x = self.to_rgba(self._A, self._alpha) File "C:\python25\lib\site-packages\matplotlib\cm.py", line 75, in to_rgba x = self.norm(x) File "C:\python25\lib\site-packages\matplotlib\colors.py", line 593, in __call __ val = ma.asarray(value).astype(npy.float) File "C:\python25\lib\site-packages\numpy\core\ma.py", line 1151, in astype d = self._data.astype(tc) MemoryError Is there some maximum number of pixels imshow can handle? Any other suggestions? Platform Details: MPL 0.91.2 (sorry, I didn't realize I was running such an old version, maybe I just need to upgrade?), Python 2.5.2, Windows XP 2002 SP3, 504MB physical RAM, 1294MB VM Page size (1000MB init., 5000MB max) Thanks! DG
On 4-Sep-08, at 10:03 PM, Josh Lawrence wrote: > Hey all, > > When I plot using python 2.5.2 and matplotlib 0.98.3 (and 0.98.1) I > have the following problem. If I run a script from the command line > that plots and saves the figure, I get the default aspect ratio of (8, > 6). If, however, I close the plotting window and replot without > exiting the python prompt and starting anew, the aspect changes to > something like (8, 6.04). I can reliably get the (8, 6) aspect ratio > if I quit the python prompt and load a new prompt. The problem only > comes after I close the plot window and replot. I just attempted to reproduce your problem with 0.98.3 and couldn't; I managed to get identical screenshots after closing the window and replotting. Several things you could tell us that might help isolate the problem: - What GUI backend? TkAgg I'm assuming? If you're unsure, import matplotlib and use the matplotlib.get_backend() function. - What plotting commands are you using? - Does the aspect ratio change if you do something simple like, say, import numpy from pylab import * x = numpy.randn(50,50) imshow(x) (close window) imshow(x) import numpy from pylab import * x = numpy.arange(1,10) plot(x, x**2) (close window) plot(x,x**2) Neither of these lead to an aspect ratio shift for me, on OS X 10.5 with the TkAgg backend, same version of matplotlib. David
There is a SciPy Cookbook here: http://www.scipy.org/Cookbook And also a more general Python cookbook here: http://code.activestate.com/recipes/langs/python/ Other list members may have other resources, too, but those are two I use on a regular basis. Mike Kaushik Ghose wrote: > Hi Everyone, > > As I've been learning python and using it more and more in my analysis work I've > been wondering where I can go to post and find code snippets for python. A > central file exchange, much like matlab's file exchange, would be great. > > I'm thinking of a very streamlined, blog like interface, where you log in, > upload a bunch of .py files and then write a little description of what the code > does and add some tags to it. > > So now we have a little repository where we can go and find code snippets to > help us learn python. > > Is there such a repository? > > Thanks > -Kaushik > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
Hi Everyone, As I've been learning python and using it more and more in my analysis work I've been wondering where I can go to post and find code snippets for python. A central file exchange, much like matlab's file exchange, would be great. I'm thinking of a very streamlined, blog like interface, where you log in, upload a bunch of .py files and then write a little description of what the code does and add some tags to it. So now we have a little repository where we can go and find code snippets to help us learn python. Is there such a repository? Thanks -Kaushik
You could do something like: def bitget(value, bit_number): return (value & (1 << bit_number)) != 0 which will return True or False for the given bit number, and this function works on numpy arrays. (Bits are numbered base-0 -- I don't know if that matches matlab). Hope that helps, Mike Marjolaine Rouault wrote: > Hi, > > I was wondering if python has the equivalent of the matlab bitget.m function. > > I have a large 2 dimensional variable of type uint32 which I must convert to binaries and then find if bit 23 of the binary for each point is 0 or 1. The matlab bitget function is ideal for that but I can't find much in python. The only thing I found was binary_repr which converts to a sting and can only be used for 1 point at a time. > > Any suggestions? > > Thanks, Marjolaine. > > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
Hi, I was wondering if python has the equivalent of the matlab bitget.m function. I have a large 2 dimensional variable of type uint32 which I must convert to binaries and then find if bit 23 of the binary for each point is 0 or 1. The matlab bitget function is ideal for that but I can't find much in python. The only thing I found was binary_repr which converts to a sting and can only be used for 1 point at a time. Any suggestions? Thanks, Marjolaine. -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support.
Thanks for the report. Indeed, it was drawing the fill over top of the hatch, rather than the other way around. This has now been fixed in SVN r6068. You can use that patch to patch your local copy, if you're not tracking SVN. Cheers, Mike Crend King wrote: > I tried hatch option in pylab.bar() in both matplotlib 0.98.2 and > 0.98.3. The hatch_demo.py in the example directory only draw four grey > bars, no hatch or them. However, when I try the same script on > matplotlib 0.91.4 (the maintainance version), it's working. I wonder > if it is a bug introduced recently? If so, it's good to have it fixed, > right? > > BTW: can I set the line width for the hatches? > > Thanks! > > ------------------------------------------------------------------------ > See how Windows Mobile brings your life together—at home, work, or on > the go. See Now > <http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/> > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
Erik Tollerud wrote: > I've been playing with some of the projections in matplotlib, > recently, and have some questions/noticed some odd behavior: > > 1. Is there any way to activate a projection mode with the pyplot > interface other than the subplot(111,projection='whatever') method a > la /examples/api/custom_projection_example.py ? Along these same > lines, is the projection feature documented in greater detail > somewhere? About everything I've figured out has come from > custom_projection_example.py ... > There is some additional documentation in the new documentation here: http://matplotlib.sourceforge.net/doc/html/devel/add_new_projection.html > 2. I have a skymap I would like to plot using a particular projection > - what I've been doing so far is specifying x and y coordinates using > mgrid and calling contourf(x,y,data,100) to approximate this. But > what I'd rather do is something like > imshow(data,extent=[-pi,pi,-pi/2,pi/2]) ... when I call that with a > projection axis activated, the projection isn't honored - the image > just appears as a regular square box. Is there any way to get imshow > to respect the projection? > As Jae-Joon suggested, try pcolor. It will be slower (and there are no interpolation options), but it should use the custom projection. imshow is really optimized for uniform, rectilinear images. Cheers, Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
Jeff Whitaker wrote: > Eric Firing wrote: >> Jeff Whitaker wrote: >>> Michael Roettger wrote: >>>> Hi all, >>>> >>>> maybe I've misunderstood something concerning masking or quiver plots: >>>> I want to exclude some data from a quiver plot. Here's an example: >>>> >>>> --------------------8<---- >>>> import numpy as N >>>> import pylab as pl >>>> import matplotlib.numerix.ma as ma >>>> >>>> # prepare data >>>> X,Y = pl.meshgrid(range(5),range(5)) >>>> angles = pl.rand(5,5) >>>> U = N.cos(angles) >>>> V = N.sin(angles) >>>> >>>> # prepare mask >>>> M = N.zeros((5,5), dtype='bool') >>>> M[2,2] = True >>>> >>>> # apply mask >>>> Um = ma.masked_array(U,mask=M) >>>> Vm = ma.masked_array(V,mask=M) >>>> >>>> # plot >>>> pl.quiver(X,Y,Um,Vm) >>>> # pl.plot(range(5),Um[2],'x') >>>> >>>> pl.show() >>>> ---------------------->8---- >>>> >>>> Using the commented 'plot' command works as expected, but 'quiver' >>>> results in >>>> empty axes. If I take U,V instead of Um,Vm, the arrows are drawn .. >>>> What am I doing wrong or is there another way to exclude arrows from >>>> being >>>> plotted? >>>> >>>> Thank you in advance, >>>> >>>> Michael >>>> >>>> >>> >>> Michael: I've fixed this now in svn. If you don't want to update to >>> svn trunk, you can make this simple change in quiver.py >> >> Jeff, >> >> Thanks for the quick fix--it will help for now, and will work in most >> use cases, but it is not actually correct in general. The problem is >> that quiver supports input of changed values of U, V, and C on the >> existing X, Y grid, and these changed values can be masked arrays with >> different points masked. (See Quiver.set_UVC().) That is why I did not >> use delete_masked_points in the first place. Masked values used to be >> handled correctly; I suspect the bug is actually in collections, not >> in quiver itself. I can't track it down right now, but may be able to >> look at it over the weekend. >> >> Eric > > OK Eric - I figured you'd chime in when you got a chance. Let's > consider it a temporary workaround then. BTW: I updated the > quiver_demo.py example to test the masking. Very useful, thank you. I have removed the workaround and made a more consistent repair to the masked array handling. The problem came in when PolyCollection was changed to automatically close the path by default. Eric > > > -Jeff >> >>> >>> --- lib/matplotlib/quiver.py (revision 6046) >>> +++ lib/matplotlib/quiver.py (working copy) >>> @@ -334,6 +334,12 @@ >>> def __init__(self, ax, *args, **kw): >>> self.ax = ax >>> X, Y, U, V, C = self._parse_args(*args) >>> + if C is not None: >>> + X, Y, U, V, C = >>> delete_masked_points(X.ravel(),Y.ravel(),U.ravel(), >>> + V.ravel(),C.ravel()) >>> + else: >>> + X, Y, U, V = >>> delete_masked_points(X.ravel(),Y.ravel(),U.ravel(), >>> + V.ravel()) >>> self.X = X >>> self.Y = Y >>> self.XY = np.hstack((X[:,np.newaxis], Y[:,np.newaxis])) >>> >>> >>> -Jeff >>> >> > >
Hey all, When I plot using python 2.5.2 and matplotlib 0.98.3 (and 0.98.1) I have the following problem. If I run a script from the command line that plots and saves the figure, I get the default aspect ratio of (8, 6). If, however, I close the plotting window and replot without exiting the python prompt and starting anew, the aspect changes to something like (8, 6.04). I can reliably get the (8, 6) aspect ratio if I quit the python prompt and load a new prompt. The problem only comes after I close the plot window and replot. The new aspect ratio is consistent after it first changes. That is, if I plot, close the window, replot, close the window, and replot again, the 2nd and 3rd figures would save with the same aspect ratio while the first would have the one I desire. What could be the problem? Cheers, Josh
I tried hatch option in pylab.bar() in both matplotlib 0.98.2 and 0.98.3. The hatch_demo.py in the example directory only draw four grey bars, no hatch or them. However, when I try the same script on matplotlib 0.91.4 (the maintainance version), it's working. I wonder if it is a bug introduced recently? If so, it's good to have it fixed, right? BTW: can I set the line width for the hatches? Thanks! _________________________________________________________________ See how Windows Mobile brings your life together—at home, work, or on the go. http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/