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
(13) |
3
(13) |
4
(11) |
5
(15) |
6
(16) |
7
(1) |
8
(2) |
9
(1) |
10
(16) |
11
(19) |
12
(8) |
13
(20) |
14
(9) |
15
(2) |
16
(9) |
17
(29) |
18
(14) |
19
(13) |
20
(10) |
21
(1) |
22
(3) |
23
(4) |
24
(26) |
25
(11) |
26
(11) |
27
(8) |
28
(4) |
29
(2) |
30
(10) |
31
(17) |
|
|
|
|
From: Brian B. <b-m...@bb...> - 2005-05-17 23:46:11
|
Hello, I was wondering if there were any tips for people like myself that generate plot images to be rendered for CGI scripts. I'd like to offer some of the things I have learned on the subject thus far: Changed .matplotlibrc's backend parameter to Agg. This seems to yield the best quality output results. This way, I can compile without Tk and GTK support. I did not find any way to easily call distutils with arguments to disable these things, so I had to comment out the setup.py script after I patched it with the FreeBSD port patches. This is on a box without a monitor, so I won't be doing any interactive graphing anytime soon. :) After realizing on my slower box (Pentium2 400MHz) that: import pylab takes a while. I just assumed most people don't restart matplotlib's runtime initialization for every graph they produce, but rather, for interactive graphing. This is pure guess, however. Also, I'd like to know if using pylab directly is a bad idea for non-interactive graphing. It seems to work okay but I've read through some past mail on this list that importing matplotlib is better than pylab if doing interface design(?) I also read that pylab tries to do more for setting up the environment for interactive graphing, so maybe I don't need this. I've done some profiling on the import using Python's profile module and later found the hotshot module to help quite a bit with accuracy. I'll try to post some of my speedups once I make sure they aren't pure hacks. Some of it was the mathtext regexp work, but a surprising amount of time was spent in a docstring magic/generation function! I switched to using FastCGI to avoid some of the startup cost of matplotlib on my slower server box. FastCGI is a way to speed up CGI programs, as the name may imply. :) Unfortunately, stdout with FastCGI is wrapped in a special little request object that isn't a true file object. I had to use the tempfile Python module for matplotlib to write its output to. I had tracked down where matplotlib did this (it was in some C module) but it's been a while since I messed with it. A final issue I ran into was permissions in a Web server environment. I run the CGI application through FastCGI under a restricted user because it doesn't need much permission to do anything else. Unfortunately, I noticed I have to do some magic at runtime of my script to set my HOME path so that the matplotlib font manager will write its ttfcache file to a place that the CGI script can write to. It's not a big deal, but I did have to look through the font manager source to figure out why it was raising an exception. I hope this information helps others who want to produce great graphical output using matplotlib that is targetted for the Web. I had to figure it out for myself by searching and testing quite a bit. My apologies for the long email. It's my first post that I tried to offer suggestions to others instead of being a read-only list subscriber. :) Thanks, Brian |
From: Graeme O'K. <gj...@ne...> - 2005-05-17 23:23:27
|
Hi Jeff, yes, I did (fink-0.23.9.tar.gz install, ./bootstrap.sh etc. all went well and I was able to re-install emacs which had also broken with the 10.4 upgrade.) I shall await 10.4 upgrades. In the interim, http://pythonmac.org/packages/matplotlib-0.72.1-py2.3-macosx10.3.zip http://pythonmac.org/packages/numarray-1.1.1-py2.3-macosx10.3.zip http://pythonmac.org/packages/TigerPython23Compat.pkg.zip (fixes up site-packages location) have allowed me to get pylab imported, now I just need to get a backend compiled (gtk is my preferred backend). thanks, Graeme On 18/05/2005, at 12:06 AM, Jeff Whitaker wrote: > Graeme O'Keefe wrote: > > >> I have just upgraded to OS X 10.4 on two machines. On one >> machine, pylab worked fine, on my notebook it hangs. I have begun >> trying to rebuild my fink tree but bomb at glib 2.6.2 / gtk+, >> pango-1.8.0 using fink as well as standalone installs for old >> items (pango is at 1.6 on fink, need 1.8 for gtk+2.6.0). >> >> As an aside, numarray install bombed with gcc4.0 so I had to >> revert to gcc3.3. >> >> Anyone else had problems with OS X 10.4 and pylab? >> >> regards, >> >> Graeme >> >> >> >> >> > Graeme: Did you follow the instructions for upgrading fink for > 10.4 on the fink home page? It's a tricky upgrade - many (if not > all) packages need to rebuilt. Many packages are not yet working, > since many developers (like me) don't yet have 10.4. > > -Jeff > > > -- > Jeffrey S. Whitaker Phone : (303)497-6313 > NOAA/OAR/CDC R/CDC1 FAX : (303)497-6449 > 325 Broadway Web : http://www.cdc.noaa.gov/~jsw > Boulder, CO, USA 80305-3328 Office: Skaggs Research Cntr 1D-124 > > |
From: John H. <jdh...@ac...> - 2005-05-17 22:47:04
|
>>>>> "Derrick" == Derrick Snowden <Der...@no...> writes: Derrick> When I plot the data with missing values (say the mask is Derrick> 1.0e20) it obviously screws up the range of the y limits. Derrick> I've seen other packages which understand a missing_value Derrick> attribute or a fill_value attribute and leave that Derrick> section of the curve blank. I was hoping for a behavior Derrick> similar to Matlab, when the data vector contains NaNs. I Derrick> see some mention of this in the matplotlib-devel list Derrick> (J. Whitaker's patch for pcolor) and I see a keyword Derrick> argument for contourf that seems to address this Derrick> situation. Is there anything for line plots? Eric Firing contributes a patch for masked array support for line plots which is in CVS. I haven't tried this with date plots but there is every reason to believe it will "just work" See examples/masked_demo.py in CVS. Let me know! JDH |
From: Derrick S. <Der...@no...> - 2005-05-17 20:58:21
|
OK, I've passed the glitches with the dates and am on to plotting a time series of data using plot_date. My data are currently represented as a masked array and there are missing values. I vaguely remember seeing something about this while I was reading but I can't for the life of me find it and the search facility on the sourceforge mailing list site is down. When I plot the data with missing values (say the mask is 1.0e20) it obviously screws up the range of the y limits. I've seen other packages which understand a missing_value attribute or a fill_value attribute and leave that section of the curve blank. I was hoping for a behavior similar to Matlab, when the data vector contains NaNs. I see some mention of this in the matplotlib-devel list (J. Whitaker's patch for pcolor) and I see a keyword argument for contourf that seems to address this situation. Is there anything for line plots? Thanks again, Derrick |
From: Florian L. <mai...@xg...> - 2005-05-17 19:47:20
|
Am Dienstag, 17. Mai 2005 19:43 schrieb John Hunter: > >>>>> "Florian" == Florian Lindner <mai...@xg...> writes: > > Florian> Hello, how does loc=0 (best) affects the placement of the > Florian> legend? I can't really figure out any influence. There is > Florian> space (on the upper left) where the legend could be > Florian> placed without hiding any lines but it's still placed on > Florian> the upper right. > > If what you say is correct, then it is a bug. Please post a complete > example. It is correct. But the John Gill gave me a explanation of this behavior which is correct for my case. It is not a bug, just a lazy implementation of the feature and he is aware of that. Florian |
From: John G. <jn...@eu...> - 2005-05-17 19:42:44
|
This might be a feature rather than a bug. The legend auto-placement code is a bit lazy -- due to the fact that I wrote it rather than JDH :) Anyway, it only tries to avoid the points that define a line, rather than the lines themselves. Much of the time that works well, but since it only takes two points to define a line you can end up with the lines crossing the legend. The good news is that if a line does cross the legend, and you can see a better position for the legend then it almost surely means that the line is straight throughout the region where it crosses the legend. Try using the pan/zoom buttons on your plot to move a point into the legend area and it should jump out of the way. Eg: try this little snippet -- use your pan/zoom skills to position one of the dots over the legend ;) from pylab import * plot(range(5), 'o-', label='oops') legend(loc=0) show() John John Hunter wrote: > >>>>> "Florian" == Florian Lindner <mai...@xg...> writes: > > Florian> Hello, how does loc=0 (best) affects the placement of the > Florian> legend? I can't really figure out any influence. There is > Florian> space (on the upper left) where the legend could be > Florian> placed without hiding any lines but it's still placed on > Florian> the upper right. > > If what you say is correct, then it is a bug. Please post a complete > example. > > JDH > > > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click > <http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click> > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Fernando P. <Fer...@co...> - 2005-05-17 19:17:05
|
Derrick Snowden wrote: > You're probably right about this, months are ambiguously defined. But, > I'm even more confused now about the documentation that you found. I'm > hoping this is a version issue but I couldn't find a function > definition like that. I tried using pydoc and pdoc, pdef, pinfo etc in > ipython on a linux machine as well as a Windows machine. The only thing > I can come up with is the following > > > class timedelta(__builtin__.object) > Difference between two datetime values. > > Where am I going wrong? I ran into the same problem, the docstring-based docs for that module are really crappy (and that's all ipython can find). So I reverted to the module listing in the HTML python docs to read the full docs for the datetime module. Here's the online version (what I pasted was from the local copy for my version, 2.3.4): http://docs.python.org/lib/module-datetime.html HTH, f |
From: Derrick S. <Der...@no...> - 2005-05-17 19:10:23
|
Fernando Perez wrote: > Derrick Snowden wrote: > >> Finally, I find the documentation for datetime.timedelta to be pretty >> sparse. I was trying to construct a datetime sequence using >> matplotlib.dates.drange which had a monthly timestep. >> >> delta = datetime.timedelta(months=1) didn't seem to work. I tried a >> few variations on this to no avail. > > > Well, the docs for timedelta give this constructor: > > ============================================ > class timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, > minutes=0, hours=0, weeks=0) > > All arguments are optional. Arguments may be ints, longs, or floats, > and may be positive or negative. > ============================================ > > I'd guess that the reason why you don't see years nor months in there is > because those can't be uniquely defined in terms of fundamental time > units (for the sake of simplicity, in multiples or submultiples of > seconds). You're probably right about this, months are ambiguously defined. But, I'm even more confused now about the documentation that you found. I'm hoping this is a version issue but I couldn't find a function definition like that. I tried using pydoc and pdoc, pdef, pinfo etc in ipython on a linux machine as well as a Windows machine. The only thing I can come up with is the following class timedelta(__builtin__.object) Difference between two datetime values. Where am I going wrong? > > I'm not an expert on handling time-based data, so this is just a common > sense guess. > > Best, > > f |
From: Fernando P. <Fer...@co...> - 2005-05-17 18:55:51
|
Derrick Snowden wrote: > Finally, I find the documentation for datetime.timedelta to be pretty > sparse. I was trying to construct a datetime sequence using > matplotlib.dates.drange which had a monthly timestep. > > delta = datetime.timedelta(months=1) didn't seem to work. I tried a few > variations on this to no avail. Well, the docs for timedelta give this constructor: ============================================ class timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0) All arguments are optional. Arguments may be ints, longs, or floats, and may be positive or negative. ============================================ I'd guess that the reason why you don't see years nor months in there is because those can't be uniquely defined in terms of fundamental time units (for the sake of simplicity, in multiples or submultiples of seconds). I'm not an expert on handling time-based data, so this is just a common sense guess. Best, f |
From: Derrick S. <Der...@no...> - 2005-05-17 18:32:37
|
Hi all, I'm new to matplotlib and trying to adapt some of the examples to my own data. Most of the time I read data from a netcdf file using the Scientific.IO.NetCDF module. When I read a time variable it usually has a units attribute that looks something like "days since 1900-01-01 00:00:00 -5". The units of measurement (here it was days) can be hours, seconds, weeks, whatever. Most of the examples in the mpl examples directory that deal with dates, start with the time information already parsed into year, month, day etc and then they create a datetime instance. Any pointers on parsing a serial date like the one I have into year, month, day in a somewhat general way? I currently use a package (cdat) which doesn't compile on Windows yet and I need a windows and unix solution. Finally, I find the documentation for datetime.timedelta to be pretty sparse. I was trying to construct a datetime sequence using matplotlib.dates.drange which had a monthly timestep. delta = datetime.timedelta(months=1) didn't seem to work. I tried a few variations on this to no avail. Thanks for any suggestions. Derrick |
From: Fernando P. <Fer...@co...> - 2005-05-17 18:30:40
|
Keith Goodman wrote: > Your screenshots---WOW! > > I installed matplotlib 0.80 (from source). Now the screenshots are on > my computer. But I can't interact with them. As soon as I enter show() > the plot appears in both python and ipython and then the prompt > disappears. If I type, for example, xlabel('Year') and ylabel('Number > of geeky science fiction desktop backgrounds') nothing happens. (I can > use the GUI controls on the plot.) > > Eventually I enter control-c in ipython and get > > $ python2.3-ipython You should use 'ipython -pylab' instead, so that ipython can coordinate the gui and python threads for you. Cheers, f |
From: John H. <jdh...@ac...> - 2005-05-17 18:29:14
|
>>>>> "Keith" == Keith Goodman <kwg...@gm...> writes: Keith> Your screenshots---WOW! I installed matplotlib 0.80 (from Thanks! Keith> source). Now the screenshots are on my computer. But I Keith> can't interact with them. As soon as I enter show() the Keith> plot appears in both python and ipython and then the prompt Keith> disappears. If I type, for example, xlabel('Year') and Keith> ylabel('Number of geeky science fiction desktop Keith> backgrounds') nothing happens. (I can use the GUI controls Keith> on the plot.) Keith> Eventually I enter control-c in ipython and get Run ipython in pylab mode > ipython -pylab You then do not need to import pylab (ipython does this for you) and you do not, indeed must not, use show. See http://matplotlib.sourceforge.net/interactive.html and http://matplotlib.sourceforge.net/faq.html#SHOW Have fun... JDH |
From: Keith G. <kwg...@gm...> - 2005-05-17 18:24:22
|
Your screenshots---WOW! I installed matplotlib 0.80 (from source). Now the screenshots are on my computer. But I can't interact with them. As soon as I enter show() the plot appears in both python and ipython and then the prompt disappears. If I type, for example, xlabel('Year') and ylabel('Number of geeky science fiction desktop backgrounds') nothing happens. (I can use the GUI controls on the plot.) Eventually I enter control-c in ipython and get $ python2.3-ipython Python 2.3.5 (#2, May 4 2005, 08:51:39) Type "copyright", "credits" or "license" for more information. IPython 0.6.13 -- An enhanced Interactive Python. ? -> Introduction to IPython's features. %magic -> Information about IPython's 'magic' % functions. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. In [1]: from pylab import * In [2]: plot([1,2,3,4]) Out[2]: [<matplotlib.lines.Line2D instance at 0x405cfe6c>] In [3]: show() xlabel('Year') ylabel('Number of geeky science fiction desktop backgrounds') --------------------------------------------------------------------------- exceptions.KeyboardInterrupt Traceback (most recent call last) /home/me/<console> /usr/lib/python2.3/site-packages/matplotlib/backends/backend_gtk.py in show(mainloop) 85 86 if mainloop and gtk.main_level() =3D=3D 0: ---> 87 gtk.main() 88 89 KeyboardInterrupt: In [4]: |
From: John H. <jdh...@ac...> - 2005-05-17 17:44:00
|
>>>>> "Florian" == Florian Lindner <mai...@xg...> writes: Florian> Hello, how does loc=0 (best) affects the placement of the Florian> legend? I can't really figure out any influence. There is Florian> space (on the upper left) where the legend could be Florian> placed without hiding any lines but it's still placed on Florian> the upper right. If what you say is correct, then it is a bug. Please post a complete example. JDH |
From: Florian L. <mai...@xg...> - 2005-05-17 17:32:10
|
Hello, how does loc=0 (best) affects the placement of the legend? I can't really figure out any influence. There is space (on the upper left) where the legend could be placed without hiding any lines but it's still placed on the upper right. Thanks, Florian |
From: Perry G. <pe...@st...> - 2005-05-17 16:16:25
|
On May 17, 2005, at 11:50 AM, John Hunter wrote: >>>>>> "Perry" == Perry Greenfield <pe...@st...> writes: > > Perry> Yes, indeed. > > I know you don't want to get into the business of porting numarray > functionality back to Numeric :-) but do you know of an easy way to > generalize this to N dimensions for Numeric. I took a brief look at > how numarray did it, and it relies on choose under the hood, but it > didn't look like it would be straightforward to port to Numeric. > > An Nd "find" would be useful in mpl, at least until the whole array > object scenario stabilizes. > > JDH numarray does it at a low level which wouldn't be easy to duplicate in Numeric. But I don't think it is that hard to do in Python so long as you don't mind using ravel() and generating an intermediate index array. Something like (not checked or tested, surely there's a mistake in it somewhere)? def find(condition): ind = nonzero(ravel(condition)) cshape = multiply.accumulate(condition.shape)[-1:0:-1] indices = [] # probably better done as a list comprehension but I'm too lazy to look it up for size in cshape: indices.append(ind//size) indices.append(ind % condition.shape[-1] return tuple(indices) But I may be missing a complication. Perry |
From: John H. <jdh...@ac...> - 2005-05-17 15:52:20
|
>>>>> "Nicolas" == Nicolas Gruel <hu...@ya...> writes: Nicolas> I disagree with you on it John the example I show you was Nicolas> with a small vector but I did this with some spectra with Nicolas> thousands points and more than one spectra in the same Nicolas> plot. Even if I want only a plot with 10% of all the Nicolas> spectrum (I want to study a specific wavelength region Nicolas> for example) I have all (100%) the spectra in the file Nicolas> and that can means a lot of point completely not Nicolas> revlevant for this specific plot. That can increase a lot Nicolas> the size of the file. I did the test and when I cut Nicolas> myself by hand the specific range I want to plot the size Nicolas> of the eps or svg file decrease by a huge amount (totally Nicolas> dependant of the spectra) OK, I understand. This is the problem of data clipping we have discussed on this list before. Would you mind filing a support request for this on the sf site? http://sourceforge.net/tracker/?group_id=80706&atid=560721 JDH |
From: John H. <jdh...@ac...> - 2005-05-17 15:50:52
|
>>>>> "Perry" == Perry Greenfield <pe...@st...> writes: Perry> Yes, indeed. I know you don't want to get into the business of porting numarray functionality back to Numeric :-) but do you know of an easy way to generalize this to N dimensions for Numeric. I took a brief look at how numarray did it, and it relies on choose under the hood, but it didn't look like it would be straightforward to port to Numeric. An Nd "find" would be useful in mpl, at least until the whole array object scenario stabilizes. JDH |
From: Perry G. <pe...@st...> - 2005-05-17 15:44:12
|
On May 17, 2005, at 11:30 AM, John Hunter wrote: >>>>>> "Perry" == Perry Greenfield <pe...@st...> writes: > > Perry> It's simpler in numarray: > > Perry> i,j = where(z<0.5) > > Perry> For numeric it's more work: > > Perry> ind = where(z.flat < 0.5) i = ind//z.shape[1] j = ind % > Perry> z.shape[1] > > Perry> One could turn this into a function for Numeric (to handle > Perry> all dimensionalities, etc) > > I think you meant to use "nonzero" rather than "where" for Numeric... Yes, indeed. |
From: John H. <jdh...@ac...> - 2005-05-17 15:30:57
|
>>>>> "Perry" == Perry Greenfield <pe...@st...> writes: Perry> It's simpler in numarray: Perry> i,j = where(z<0.5) Perry> For numeric it's more work: Perry> ind = where(z.flat < 0.5) i = ind//z.shape[1] j = ind % Perry> z.shape[1] Perry> One could turn this into a function for Numeric (to handle Perry> all dimensionalities, etc) I think you meant to use "nonzero" rather than "where" for Numeric... from matplotlib.numerix import where, nonzero from matplotlib.numerix.mlab import rand z = rand(4,5) # It's simpler in numarray: i,j = where(z<0.5) print i,j # For numeric it's more work: ind = nonzero(z.flat < 0.5) i = ind//z.shape[1] j = ind % z.shape[1] print i,j I also think wrapping this functionality into the find function in mpl is a good idea... I frequently miss it. JDH |
From: Perry G. <pe...@st...> - 2005-05-17 15:19:46
|
It's simpler in numarray: i,j =3D where(z<0.5) For numeric it's more work: ind =3D where(z.flat < 0.5) i =3D ind//z.shape[1] j =3D ind % z.shape[1] One could turn this into a function for Numeric (to handle all=20 dimensionalities, etc) On May 17, 2005, at 10:04 AM, Dimitri D'Or wrote: > Hello, > > =A0 > > Here under a question that has probably already been asked: > > =A0 > > I would like to apply the find() function on a bidimensional array and=20= > receive as output the bidimensional indices for the elements matching=20= > the condition. This is easy in Matlab but doesn't seem to be possible=20= > with Python. > > =A0 > > Here is a short example (in Matlab code) of what I would like to have: > > =A0 > > >> z=3Drand(3,3) > > =A0 > > z =3D > > =A0 > > =A0=A0=A0 0.9501=A0=A0=A0 0.4860=A0=A0=A0 0.4565 > > =A0=A0=A0 0.2311=A0=A0=A0 0.8913=A0=A0=A0 0.0185 > > =A0=A0=A0 0.6068=A0=A0=A0 0.7621=A0=A0=A0 0.8214 > > =A0 > > >> [i,j]=3Dfind(z<0.5) > > =A0 > > i =3D > > =A0 > > =A0=A0=A0=A0 2 > > =A0=A0=A0=A0 1 > > =A0=A0=A0=A0 1 > > =A0=A0=A0=A0 2 > > =A0 > > =A0 > > j =3D > > =A0 > > =A0=A0=A0=A0 1 > > =A0=A0=A0=A0 2 > > =A0=A0=A0=A0 3 > > =A0=A0=A0=A0 3 > > =A0 > > A solution for me? > > =A0 > > Thank you, > > =A0 > > Dimitri D'Or > > =A0 |
From: Dimitri D'O. <dim...@fs...> - 2005-05-17 14:05:03
|
Hello, Here under a question that has probably already been asked: I would like to apply the find() function on a bidimensional array and receive as output the bidimensional indices for the elements matching the condition. This is easy in Matlab but doesn't seem to be possible with Python. Here is a short example (in Matlab code) of what I would like to have: >> z=rand(3,3) z = 0.9501 0.4860 0.4565 0.2311 0.8913 0.0185 0.6068 0.7621 0.8214 >> [i,j]=find(z<0.5) i = 2 1 1 2 j = 1 2 3 3 A solution for me? Thank you, Dimitri D'Or |
From: Graeme O'K. <gj...@ne...> - 2005-05-17 13:54:22
|
I have just upgraded to OS X 10.4 on two machines. On one machine, pylab worked fine, on my notebook it hangs. I have begun trying to rebuild my fink tree but bomb at glib 2.6.2 / gtk+, pango-1.8.0 using fink as well as standalone installs for old items (pango is at 1.6 on fink, need 1.8 for gtk+2.6.0). As an aside, numarray install bombed with gcc4.0 so I had to revert to gcc3.3. Anyone else had problems with OS X 10.4 and pylab? regards, Graeme |
From: Aarre L. <al...@in...> - 2005-05-17 06:19:58
|
Hello, I am getting errors using matplotlib 0.80 from Fink on Mac OS X. This used to work (back in February) with a previous version of matplotlib (0.71). In the example below, I have specified 'GTKAgg' as the backend because it was suggested that would solve a similar problem for a previous poster. However, the backend does not seem to matter. I first noticed this problem with the 'PS' backend. Thanks for any help you can offer. Aarre Laakso aarre@ganesha ~ $ python2.3 Python 2.3.5 (#1, Apr 1 2005, 11:21:40) [GCC 3.3 20030304 (Apple Computer, Inc. build 1640)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib >>> matplotlib.use('GTKAgg') >>> from pylab import * ** (:14661): WARNING **: `GtkTextSearchFlags' is not an enum type >>> plot([1,2,3]) ** (:14661): WARNING **: Cannot open font file for font Verdana 10 ** (:14661): WARNING **: Cannot open fallback font, nothing to do aarre@ganesha ~ $ fink list matplot* Information about 4872 packages read in 1 seconds. matplotlib-py22 0.80-1 Pure python 2D plotting library with a Matlab syntax i matplotlib-py23 0.80-1 Pure python 2D plotting library with a Matlab syntax matplotlib-py24 0.80-1 Pure python 2D plotting library with a Matlab syntax aarre@ganesha ~ $ fink list python23* Information about 4872 packages read in 2 seconds. i python23 1:2.3.5-2 Interpreted, object-oriented language python23-nox 1:2.3.4-3 Interpreted, object-oriented language python23-nox-shlibs 1:2.3.4-3 Interpreted, object-oriented language i python23-shlibs 1:2.3.5-2 Interpreted, object-oriented language i python23-socket 1:2.3.5-2 Socket plugin for python python23-socket-nox 1:2.3.4-3 Socket plugin for python python23-socket-ssl 1:2.3.5-1 Socket plugin for python (SSL version) aarre@ganesha ~ $ which python2.3 /sw/bin/python2.3 -- =================================================================== Aarre Laakso http://mypage.iu.edu/~alaakso/ Cognitive Development Laboratory mailto:al...@in... Indiana University, Bloomington office: 812-856-0836 1101 East Tenth Street, Psych A104 lab: 812-855-8256 Bloomington, Indiana 47405-7007, USA fax: 309-276-8745 =================================================================== |
From: Nicolas G. <hu...@ya...> - 2005-05-17 03:13:55
|
> The im2.svg file looks fine to me when rendered by > gqview. I do see > the problem you are describing in inkscape. It is > because inkscape is > not respecting the clipping rectangle. This looks > very much like an > inkscape bug and not a matplotlib bug so you should > file a bug report > or a support request on the inkscape project, or > just look for a > status report on clipping. oki I will do this. > Nicolas> software who can edit vectoriel format. > Another problem > Nicolas> is the size of this files who are far > too big. I don't > Nicolas> know how to change it. In a bitmap file > like png file or > Nicolas> jpg that doesn't matter because the > pixel are just > Nicolas> overlay but we loose the interest to > have a vectoriel > Nicolas> format. One solution is that the user > cut himself is plot > Nicolas> but it's not the good way (I think). > > I don't think there is a problem with file size for > SVG (I'm getting > 12k for the one created by your script). There is a > problem with EPS > because we are embedding the entire truetype font in > the file. This > is a known bug which will be fixed as soon as we can > so please bear > with us. You can set the rc parameter > > > ps.useafm : True # use of afm fonts -- > breaks mathtext but results in small files > > To avoid this problem with PS/EPS file size. I disagree with you on it John the example I show you was with a small vector but I did this with some spectra with thousands points and more than one spectra in the same plot. Even if I want only a plot with 10% of all the spectrum (I want to study a specific wavelength region for example) I have all (100%) the spectra in the file and that can means a lot of point completely not revlevant for this specific plot. That can increase a lot the size of the file. I did the test and when I cut myself by hand the specific range I want to plot the size of the eps or svg file decrease by a huge amount (totally dependant of the spectra) But anymay thanks to point me the problem with inkscape, I'll tell them. N. _____________________________________________________________________________ Découvrez le nouveau Yahoo! Mail : 1 Go d'espace de stockage pour vos mails, photos et vidéos ! Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com |