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
(10) |
2
(3) |
3
(5) |
4
(7) |
5
(18) |
6
(4) |
7
(15) |
8
(7) |
9
(10) |
10
(4) |
11
(18) |
12
(15) |
13
(11) |
14
(11) |
15
(4) |
16
(28) |
17
(17) |
18
(22) |
19
(12) |
20
(19) |
21
(17) |
22
(14) |
23
(4) |
24
(3) |
25
(6) |
26
(8) |
27
(13) |
28
(11) |
29
(21) |
30
(3) |
31
(5) |
|
|
|
|
|
|
Arg, I hoped that you would not say that :-) Le Mardi 19 D=E9cembre 2006 16:39, Jeff Whitaker a =E9crit=A0: > Lionel Roubeyrie wrote: > > Hi all, > > I don't find any doc on this point, then I post my question here: is it > > possible to set texts with a colorbar, like a legend? > > You can have a look of what I want here: > > http://www.limair.asso.fr/previsions2/index.php (just click "OK") > > thanks > > Lionel: I don't think there is any automatic way to do this, but you > can do it manually with pylab.text > (http://matplotlib.sourceforge.net/matplotlib.pylab.html#-text). > > -Jeff =2D-=20 Lionel Roubeyrie - lro...@li... LIMAIR http://www.limair.asso.fr
Sorry for the previsou post. Tweaking a bit I found that probably the problem is not in the visualisation but in cleaning memory. I use a function to make four plot calling two subfunction. the plot are called plotrisp and plotlev in everyone of them any tome i use a figure I also close it. But if I only use one fuction it do the plot. WhenI try to use them to plot no way it stuck in the end. So I had the same problem while calling multiple plots with multiple function Any help would be appreciated and sorry for the dup post nstep=30 Giorgio
Lionel Roubeyrie wrote: > Hi all, > I don't find any doc on this point, then I post my question here: is it > possible to set texts with a colorbar, like a legend? > You can have a look of what I want here: > http://www.limair.asso.fr/previsions2/index.php (just click "OK") > thanks > > Lionel: I don't think there is any automatic way to do this, but you can do it manually with pylab.text (http://matplotlib.sourceforge.net/matplotlib.pylab.html#-text). -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/PSD R/PSD1 Email : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-124 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
Hi all, I don't find any doc on this point, then I post my question here: is it possible to set texts with a colorbar, like a legend? You can have a look of what I want here: http://www.limair.asso.fr/previsions2/index.php (just click "OK") thanks -- Lionel Roubeyrie - lro...@li... LIMAIR http://www.limair.asso.fr
I've retried reloading the matrices after restaring everything twice and it seems to plot. Probably the problem is that the memory is "occupied" from previous plots. I noticed also that the possibility to command come back to the console only after the last plot is close manually ..any hints Is there a way to "clean" the memory for a new start.. the command close doesn't seem to work ? Here's the module that make the only previous plot before trying to do the meshcountour
>>>>> "David" == David Cournapeau <da...@ar...> writes: David> In make_image, most of the time is taken into to_rgba: David> almost half of it is taken in by the take call in the David> Colormap.__call__. Almost 200 ms to get colors from the David> indexes seems quite a lot (this means 280 cycles / pixel on David> average !). I can reproduce this number by using a small David> numpy test. David> On my laptop (pentium M, 1.2 Ghz), make_image takes almost David> 85 % of the time, which seems to imply that this is where David> one should focus if one wants to improve the speed, This may have been lost in the longer thread above, but what interpolation are you using? You may see a good performance boost by using interpolation='nearest'. Also, with your clip changes and with Eric's changes is it still painfully slow for you -- how much have these changes helped? Of time time spent in make image, how much is _image.fromarray, ScalarMappable.to_rgba and _image.resize?
>>>>> "Olivier" == Olivier ATTEIA <Oli...@eg...> writes: Olivier> Hello, sorry to bother you but I did not find a reply Olivier> elsewhere, I am using matplotlib with python 2.4 and Olivier> windows XP and it is a really nice tool. It is inside a Olivier> wxapplication. I have a problem because the user can Olivier> change the graph settings as he wants and draws several Olivier> times contours from 50 by 200 matrices. After some time Olivier> the program slows down and the memory is increasing Olivier> regularly. I don't understand because I use a command Olivier> similar as in matplotlib clear command : collections=[] Olivier> between each drawing. I tried in a simpler way : just Olivier> start matplotlib(even in tk mode), make a plot(x,y) with Olivier> x=randn(100,100). First it takes a lot of memory (more Olivier> than 50 Mb). And when you clear hte figure the meory Olivier> remains high, or when you set holds(False) and make a Olivier> simple plot the first plot disappears but the memory is Olivier> still high. Do you have any idea Thanks a lot Sincerely Olivier> O. Atteia Hey Olivier, questions should go to the matplotlib-users mailing list. I'm forwarding this on. You can subscribe at http://sourceforge.net/mailarchive/forum.php?forum_id=33405 JDH
Hello to all, I'm finishing to convert a module for linear regression that I used in Matlab. It takes an experimental matrix, and a response matrix perform a regression and a bit of plot and then give me 3 matrices that I need to plot response surface and leverage surface. For plotting leverage and response I need to create a kind of grid of point with another program. and at this point everything work fine (checked also in comparison with matlab). The problems come when I tri to plot it. For a step of 2 (not really a grid) it works with 30 steps everything crashes :( so nste=2 work nstep=30 not I attach the file that give no problems it's a module with included the matrix to be plotted with nstep=2 and also the problematic one. a function with the same name of the plot and the matrices that give the problems. Every help would be greatly appreciated because if I fix it I can get rid of the regression program in matlab that i generally use really a lot in my everyday job Giorgio
Christopher Barker wrote: > yardbird wrote: > =20 >> On Saturday 16 December 2006 19:42, Xavier Gnata wrote: >> =20 > > =20 >>> Each time I'm working on C++ codes using vector or valarray, I would >>> like to be able to plot them. >>> =20 > > =20 >> you should really check out the Boost::Python libraries. They allow yo= u, among=20 >> other things, to expose your C++ container classes as python objects. = I'm=20 >> using them heavily in my project and I'm very satisfied. >> =20 > > What this means is that you'd be using python to drive your C++ code,=20 > rather than using C++ code to drive a python/mpl code. In addition to=20 > Boost::Python, there are some other options to consider: > > pyrex, Cxx, SWIG. > > The other option is to use your C++ code to drive Python. This can be=20 > done by embedding a python interpreter in your C++ app. See the=20 > odfficial pyhton docs, and lots of other stuff online. > > You also might want to check out Elmer: > > http://elmer.sourceforge.net/ > > I've never used it, but it looks pretty cool. It's a tool that provides= =20 > the infrastructure for calling python from C/C++. > > Honestly, though, I'd go with the first approach -- drive your C++ code= =20 > from Python -- I think that in addition to making it easy to plot=20 > results, etc, you'll be able to write unit tests, etc in python, and=20 > even get a full scripting engine, which could turn out to be very usefu= l.. > > -Chris > =20 Hi, I do agree that driving C++ from python looks easier thant driving python from C++. However, I really would like to inclue python code into my C++ code and not the opposite (I have special needs so I really have to do that). I'm going to have a look at embedding python. Has anyone experience with that? =20 Xavier --=20 ############################################ Xavier Gnata CRAL - Observatoire de Lyon 9, avenue Charles Andr=E9 69561 Saint Genis Laval cedex Phone: +33 4 78 86 85 28 Fax: +33 4 78 86 83 86 E-mail: gn...@ob... ############################################=20
Hi guys, I'm trying to run the pcolor demo on my own data. I have an image and I need to draw the hot colormap on it. Can you advise on how I can do it? Sorry I'm not from the computer field so please try to be clear. Thanks so much in advance, Regards, _________________________________________________________________ Think you're a film buff? Play the Movie Mogul quiz and win fantastic prizes! http://www.msnmoviemogul.com
David Cournapeau wrote: > Eric Firing wrote: >> There is a clip function in all three numeric packages, so a native >> clip is being used. >> >> If numpy.clip is actually slower than your version, that sounds like a >> problem with the implementation in numpy. By all logic a single clip >> function should either be the same (if it is implemented like yours) >> or faster (if it is a single loop in C-code, as I would expect). This >> warrants a little more investigation before changing the mpl code. >> The best thing would be if you could make a simple standalone numpy >> test case profiling both versions and post the results as a question >> to the numpy-discussion list. Many such questions in the past have >> resulted in big speedups in numpy. > I am much more familiar with internal numpy code than matplotlib's, so > this is much easier for me, too :) >> One more thought: it is possible that the difference is because myclip >> operates on the array in place while clip generates a new array. If >> this is the cause of the difference then changing your last line to >> "return a.copy()" probably would slow it down to the numpy clip speed >> or slower. > It would be scary if a copy of a 8008x256 array of double took 100 ms... > Fortunately, it does not, this does not seem to be the problem. > > cheers, > > David Ok, so now, with my clip function, still for a 8000x256 double array: we have show() after imshow which takes around 760 ms. 3/5 are in make_image, 2/5 in the function blop, which is just an alias I put to measure the difference between axes.py:1043(draw) and image.py:173(draw) in the function Axis.draw (file axes.py): def blop(dsu): for zorder, i, a in dsu: a.draw(renderer) blop(dsu) In make_image, most of the time is taken into to_rgba: almost half of it is taken in by the take call in the Colormap.__call__. Almost 200 ms to get colors from the indexes seems quite a lot (this means 280 cycles / pixel on average !). I can reproduce this number by using a small numpy test. On my laptop (pentium M, 1.2 Ghz), make_image takes almost 85 % of the time, which seems to imply that this is where one should focus if one wants to improve the speed, cheers, David
Hi folks- I'd like to report a possible way for OS X mpl users to use Apple's freetype2 (in their X11), to see if there are any problems with it I may need to be aware of, and if not, to offer it as a possible solution to others installing mpl from source on OS X. I know Apple's freetype2 was "broken" in Panther, but it's possible things are different with Tiger. The basic issue is that Apple's X11 installs a version of freetype2 under /usr/X11R6/ which might be usable by mpl, and which can conflict with other copies users might install to build mpl. With Panther (10.3), I followed mpl build instructions and installed my own freetype2. I tried two different methods: using i-Installer, and directly from source (into /usr/local/). Both approaches worked fine with mpl. However, using either version led to problems with other X11 software I tried to install. The issues I remember had to do with GTK (i.e., installing PyGTK and an unrelated GTK app, geda, from source). There were troublesome issues having to do with freetype2 and some other X11 libs. According to some anecdotal reports I found online, it appears Apple did something strange to the freetype version (at least in Panther versions of X11), so gcc/ld would link against it even if a more recent version was in /usr/local/, but then there would be freetype issues at runtime. My eventual solution involved removing various parts of Apple's X11, and putting links in /usr/X11R6/ to the new installs in /usr/local/. (I have a script to do this, if anyone needs it.) This was such a headache that when I just upgraded to Tiger (10.4; a clean install), I thought I'd see if mpl could be installed using the new freetype2 in Apple's X11. (I also did not install zlib, since 10.4 includes it in /usr/lib/.) To do so, I had to modify "add_ft2font_flags" in setupext.py, adding this to the top: # Added to provide access to Apple's freetype2 when their X11 is installed if sys.platform=='darwin': # Add paths to Apple's X11R6. module.library_dirs.extend( ['/usr/X11R6/lib']) module.include_dirs.extend( ['/usr/X11R6/include']) (Also, the docstring is incorrect and should be fixed to refer to freetype2 rather than gd.) With this change, mpl built without any errors, and as far as I can tell so far, is working just fine. I've come across a few missing font/font replacement warnings, but I don't know whether installing a new freetype2 would have avoided these. If anyone can see a problem with this procedure, please let me know. Otherwise, it means that Tiger users who have installed Apple's X11 need to install just one library (libpng) before installing mpl, so long as the above change is made to setupext.py. I don't know if the change would have any ramifications for those who don't install X11 or who do install it and *also* install freetype2 in /usr/local/. If no problems are anticipated, perhaps the change can be incorporated into mpl. Thanks for any feedback on this. -Tom ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/
>>>>> "Jeff" == Jeff Huang <hu...@ui...> writes: Jeff> Is it possible to have gradients in the bar graphs made by Jeff> matplotlib? I couldn't find anything about it in the user Jeff> guide. Here is some example code form the mailing list To: Christopher Barker <Chr...@no...> Cc: mat...@li... Subject: Re: [Matplotlib-users] graphs From: John Hunter <jdh...@ac...> Date: 2006年5月16日 15:01:15 -0500 >>>>> "Christopher" == Christopher Barker <Chr...@no...> writes: Christopher> That I don't know. The Agg renderer certainly can do Christopher> a nice job with gradients, but I don't know if MPL Christopher> support that. You can emulate gradients using matplotlib images -- either with colormaps or defining your own rgba endpoints for the gradients. Here's an example of an axes background gradient from pylab import figure, show, nx, cm fig = figure() xmin, xmax = xlim = 0,2 ymin, ymax = ylim = -1,1 ax = fig.add_subplot(111, xlim=xlim, ylim=ylim, autoscale_on=False) X = [[.6, .6],[.7,.7]] ax.imshow(X, interpolation='bicubic', cmap=cm.Blues, extent=(xmin, xmax, ymin, ymax), alpha=1) t = nx.arange(xmin, xmax,0.01) ax.plot(t, nx.sin(2*nx.pi*t), lw=2, color='black') show() Likewise, you can make your own gradient bars charts: from pylab import figure, show, nx, cm def gbar(ax, x, y, width=0.5, bottom=0): X = [[.6, .6],[.7,.7]] for left,top in zip(x, y): right = left+width ax.imshow(X, interpolation='bicubic', cmap=cm.Blues, extent=(left, right, bottom, top), alpha=1) fig = figure() xmin, xmax = xlim = 0,10 ymin, ymax = ylim = 0,1 ax = fig.add_subplot(111, xlim=xlim, ylim=ylim, autoscale_on=False) X = [[.6, .6],[.7,.7]] ax.imshow(X, interpolation='bicubic', cmap=cm.copper, extent=(xmin, xmax, ymin, ymax), alpha=1) N = 10 x = nx.arange(N)+0.25 y = nx.mlab.rand(N) gbar(ax, x, y, width=0.7) ax.set_aspect('normal') show() Viewer discretion is advised. If you want to get clever, you can define patterns and fills this way too. We should add an interface to expose this functionality more readily... JDH ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Is it possible to have gradients in the bar graphs made by matplotlib? I couldn't find anything about it in the user guide. Thanks Jeff
Pierre, Offhand, it looks like it should go into ticker.py, so I will probably do that. Eric Pierre GM wrote: > On Monday 18 December 2006 13:29, David L Goldsmith wrote: >> Simson Garfinkel wrote: >>> It really depends on your audience as to whether or not 1,000,000 >>> through 9,000,000 is better displayed in scientific notation or not. >>> For audiences that I frequently present to, any scientific notation >>> is just unacceptable. You can add quantifiers (like KBps, MBps, >>> GBps), but presenting something a 5e+5 Bps will just be lost. You >>> *might* get away with e+3, e+6, and e+9, but never the other e's. >> Ah, "Engineering" notation - that could be a useful helper function. > > A few months ago the question got asked on this very list. > The idea is to define a specific formatter. Here's what I'd come with (I copy > the initial post for convenience at the end of the message). > > If it's found useful, I could put it in the cookbook (now that I remember how > to edit the wiki). Or I could leave our dear developers add it to the core. > > > P. > > #---------------------------------------------- > > class EngrFormatter(ScalarFormatter): > """A variation of the standard ScalarFormatter, using only multiples of > three > in the mantissa. A fixed number of decimals can be displayed with the optional > parameter `ndec` . If `ndec` is None (default), the number of decimals is > defined > from the current ticks. > """ > def __init__(self, ndec=None, useOffset=True, useMathText=False): > ScalarFormatter.__init__(self, useOffset, useMathText) > if ndec is None or ndec < 0: > self.format = None > elif ndec == 0: > self.format = "%d" > else: > self.format = "%%1.%if" % ndec > #........................ > def _set_orderOfMagnitude(self, mrange): > """Sets the order of margnitude.""" > locs = N.absolute(self.locs) > if self.offset: > oom = math.floor(math.log10(mrange)) > else: > if locs[0] > locs[-1]: > val = locs[0] > else: > val = locs[-1] > if val == 0: > oom = 0 > else: > oom = math.floor(math.log10(val)) > if oom <= -3: > self.orderOfMagnitude = 3*(oom//3) > elif oom <= -1: > self.orderOfMagnitude = -3 > elif oom >= 4: > self.orderOfMagnitude = 3*(oom//3) > else: > self.orderOfMagnitude = 0 > #........................ > def _set_format(self): > """Sets the format string to format all ticklabels.""" > # set the format string to format all the ticklabels > locs = (N.array(self.locs)-self.offset) / 10**self.orderOfMagnitude + > 1e-15 > sigfigs = [len(str('%1.3f'% loc).split('.')[1].rstrip('0')) \ > for loc in locs] > sigfigs.sort() > if self.format is None: > self.format = '%1.' + str(sigfigs[-1]) + 'f' > if self._usetex or self._useMathText: > self.format = '$%s$' % self.format > #.............................................................................. > class MinimalFormatter(Formatter): > """A minimal formatter: just the plain data !""" > def __init__(self,sigfigs=None): > if sigfigs is None: > self.fmt = "%f" > else: > self.fmt = "%.%if" % sigfigs > def __call__(self,x,pos=None): > return str(self.fmt % x).rstrip('0') > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
On Monday 18 December 2006 13:29, David L Goldsmith wrote: > Simson Garfinkel wrote: > > It really depends on your audience as to whether or not 1,000,000 > > through 9,000,000 is better displayed in scientific notation or not. > > For audiences that I frequently present to, any scientific notation > > is just unacceptable. You can add quantifiers (like KBps, MBps, > > GBps), but presenting something a 5e+5 Bps will just be lost. You > > *might* get away with e+3, e+6, and e+9, but never the other e's. > > Ah, "Engineering" notation - that could be a useful helper function. A few months ago the question got asked on this very list. The idea is to define a specific formatter. Here's what I'd come with (I copy the initial post for convenience at the end of the message). If it's found useful, I could put it in the cookbook (now that I remember how to edit the wiki). Or I could leave our dear developers add it to the core. P. #---------------------------------------------- class EngrFormatter(ScalarFormatter): """A variation of the standard ScalarFormatter, using only multiples of three in the mantissa. A fixed number of decimals can be displayed with the optional parameter `ndec` . If `ndec` is None (default), the number of decimals is defined from the current ticks. """ def __init__(self, ndec=None, useOffset=True, useMathText=False): ScalarFormatter.__init__(self, useOffset, useMathText) if ndec is None or ndec < 0: self.format = None elif ndec == 0: self.format = "%d" else: self.format = "%%1.%if" % ndec #........................ def _set_orderOfMagnitude(self, mrange): """Sets the order of margnitude.""" locs = N.absolute(self.locs) if self.offset: oom = math.floor(math.log10(mrange)) else: if locs[0] > locs[-1]: val = locs[0] else: val = locs[-1] if val == 0: oom = 0 else: oom = math.floor(math.log10(val)) if oom <= -3: self.orderOfMagnitude = 3*(oom//3) elif oom <= -1: self.orderOfMagnitude = -3 elif oom >= 4: self.orderOfMagnitude = 3*(oom//3) else: self.orderOfMagnitude = 0 #........................ def _set_format(self): """Sets the format string to format all ticklabels.""" # set the format string to format all the ticklabels locs = (N.array(self.locs)-self.offset) / 10**self.orderOfMagnitude + 1e-15 sigfigs = [len(str('%1.3f'% loc).split('.')[1].rstrip('0')) \ for loc in locs] sigfigs.sort() if self.format is None: self.format = '%1.' + str(sigfigs[-1]) + 'f' if self._usetex or self._useMathText: self.format = '$%s$' % self.format #.............................................................................. class MinimalFormatter(Formatter): """A minimal formatter: just the plain data !""" def __init__(self,sigfigs=None): if sigfigs is None: self.fmt = "%f" else: self.fmt = "%.%if" % sigfigs def __call__(self,x,pos=None): return str(self.fmt % x).rstrip('0')
Simson Garfinkel wrote: > Well, I come from the United States, where we basically ignore > international standards and let the rest of the world do what it > wants. Except when it annoys us. > Insert wink or smiley face here to signify irony, yes? > However, there is something called an internationalization which > tells clever programmers who use it what to use as a digits separator > and what to use as a decimal point. Support for I18N is built into > most operating systems. Unfortunately, I don' t know the Python API. > Does anybody? > > On Dec 18, 2006, at 10:35 AM, John Travers wrote: > > >> On 18/12/06, Simson Garfinkel <si...@ac...> wrote: >> >>> It really depends on your audience as to whether or not 1,000,000 >>> through 9,000,000 is better displayed in scientific notation or not. >>> For audiences that I frequently present to, any scientific notation >>> is just unacceptable. You can add quantifiers (like KBps, MBps, >>> GBps), but presenting something a 5e+5 Bps will just be lost. You >>> *might* get away with e+3, e+6, and e+9, but never the other e's. >>> >> Where I come from (Europe) 9,000,000 means 9.0 and 9.000.000 means >> what you mean. That is why there is an international standard of >> having 9 000 000. Basically these things should be tunable through >> simple rc options. >> As to the point that different rc options can produce different >> results on different machines, as far as I am aware, all options can >> be overridden in the script itself (correct me if I am wrong?). >> >> Best regards, >> John >> >> ---------------------------------------------------------------------- >> --- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to >> share your >> opinions on IT & business topics through brief surveys - and earn cash >> http://www.techsay.com/default.php? >> page=join.php&p=sourceforge&CID=DEVDEV >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- ERD/ORR/NOS/NOAA <http://response.restoration.noaa.gov/emergencyresponse/>
yardbird wrote: > On Saturday 16 December 2006 19:42, Xavier Gnata wrote: >> Each time I'm working on C++ codes using vector or valarray, I would >> like to be able to plot them. > you should really check out the Boost::Python libraries. They allow you, among > other things, to expose your C++ container classes as python objects. I'm > using them heavily in my project and I'm very satisfied. What this means is that you'd be using python to drive your C++ code, rather than using C++ code to drive a python/mpl code. In addition to Boost::Python, there are some other options to consider: pyrex, Cxx, SWIG. The other option is to use your C++ code to drive Python. This can be done by embedding a python interpreter in your C++ app. See the odfficial pyhton docs, and lots of other stuff online. You also might want to check out Elmer: http://elmer.sourceforge.net/ I've never used it, but it looks pretty cool. It's a tool that provides the infrastructure for calling python from C/C++. Honestly, though, I'd go with the first approach -- drive your C++ code from Python -- I think that in addition to making it easy to plot results, etc, you'll be able to write unit tests, etc in python, and even get a full scripting engine, which could turn out to be very useful.. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no...
Simson Garfinkel wrote: > It really depends on your audience as to whether or not 1,000,000 > through 9,000,000 is better displayed in scientific notation or not. > For audiences that I frequently present to, any scientific notation > is just unacceptable. You can add quantifiers (like KBps, MBps, > GBps), but presenting something a 5e+5 Bps will just be lost. You > *might* get away with e+3, e+6, and e+9, but never the other e's. > Ah, "Engineering" notation - that could be a useful helper function. DG > > On Dec 18, 2006, at 8:53 AM, Darren Dale wrote: > > >> On Saturday 16 December 2006 20:00, Simson Garfinkel wrote: >> >>> 1. I think that scientific notation should not be the default, unless >>> numbers exceed 1E+7. >>> >> There are good reasons to use scientific notation for smaller >> numbers than >> 10e+-7: We dont want neighboring tick labels to run into each other >> on the x >> axis, and we dont tick labels to run out of the window on the y >> axis. For >> examples, see the attachments at the bottom of this page: >> http://sourceforge.net/tracker/index.php? >> func=detail&aid=1196027&group_id=80706&atid=560720 >> >> Darren >> >> > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- ERD/ORR/NOS/NOAA <http://response.restoration.noaa.gov/emergencyresponse/>
I wonder: how hard would it be to add some intelligence to the interpreter and/or exception handler such that if the manner of (mis)use of one of these implied that what the programmer meant was the other, then the error message would say something like "Perhaps you meant to use axis (or axes, as appropriate) here?" DG belinda thom wrote: > On Dec 16, 2006, at 8:10 PM, John Hunter wrote: > > >> Simson> 3. If I was going to make a major change to the API at >> Simson> this point, it would be to make it so that you don't have >> Simson> a class/function/ identifier called "axes" and another one >> Simson> called "axis." I frequently get confused between these two >> Simson> words; I imagine that non-native English speakers get >> Simson> confused even more frequently. Irregular noun plurals in >> Simson> English are confusing, and it probably isn't necessary to >> Simson> use both. One approach would be to never allow "axis," to >> Simson> only allow "xaxis" and "yaxis" and perhaps something >> Simson> (either_axis?) for the abstract super-class, but this may >> Simson> be a bigger change than you wish to consider at the >> Simson> present time. >> >> Yes, this is a confusing and poor nomenclature. We're probably stuck >> with it at this point, since it fairly deeply ingrained. >> > > The axis/axes function names are Matlab relics, so to have used > something else would probably have caused other complaints. > > On the bright side, at least w/matplotlib, you're not paying out the > wazoo :-) for such things. > > --b > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- ERD/ORR/NOS/NOAA <http://response.restoration.noaa.gov/emergencyresponse/>
Well, I come from the United States, where we basically ignore international standards and let the rest of the world do what it wants. Except when it annoys us. However, there is something called an internationalization which tells clever programmers who use it what to use as a digits separator and what to use as a decimal point. Support for I18N is built into most operating systems. Unfortunately, I don' t know the Python API. Does anybody? On Dec 18, 2006, at 10:35 AM, John Travers wrote: > On 18/12/06, Simson Garfinkel <si...@ac...> wrote: >> It really depends on your audience as to whether or not 1,000,000 >> through 9,000,000 is better displayed in scientific notation or not. >> For audiences that I frequently present to, any scientific notation >> is just unacceptable. You can add quantifiers (like KBps, MBps, >> GBps), but presenting something a 5e+5 Bps will just be lost. You >> *might* get away with e+3, e+6, and e+9, but never the other e's. > > Where I come from (Europe) 9,000,000 means 9.0 and 9.000.000 means > what you mean. That is why there is an international standard of > having 9 000 000. Basically these things should be tunable through > simple rc options. > As to the point that different rc options can produce different > results on different machines, as far as I am aware, all options can > be overridden in the script itself (correct me if I am wrong?). > > Best regards, > John > > ---------------------------------------------------------------------- > --- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php? > page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
On Sunday 17 December 2006 20:06, Eric Firing wrote: > John Hunter wrote: > [...] > > > Simson> To answer Eric's most recent posting: > > > > Simson> 1. I think that scientific notation should not be the > > Simson> default, unless numbers exceed 1E+7. > > > > I agree with this -- scientific notation kicks in too soon IMO. I > > think an rc setting would be fine. I am not adverse to more rc > > settings personally. I haven't seen too many problems arising from > > having a lot of rc settings. > > I have added an rc setting called axes.formatter.limits and set the > defaults to -7, 7, so that now scientific notation starts at 1e+-7. This > may be too large for some tastes--but at least now it is configurable. > Maybe other users will comment on what they think the defaults should > be. I don't have a strong opinion. I think think the name for this rc setting could be improved. How about: (x,y)tick.scientific_notation.threshold or axes.scientific_notation.threshold > I also added a convenience method to the Axes class (called > ticklabel_format())to make it easier to turn scientific notation on or > off on either or both axes, with the idea that other formatting control > might be added to the method later. I have not made the method a pylab > function yet; I would rather wait until it settles down and people have > had a chance to request a different name or turn thumbs down on the > whole thing or whatever. > > Suggestions for better names or other aspects of these API additions are > welcome. Something like use_scientific_notation() would be much clearer, in my opinion.
On 18/12/06, Simson Garfinkel <si...@ac...> wrote: > It really depends on your audience as to whether or not 1,000,000 > through 9,000,000 is better displayed in scientific notation or not. > For audiences that I frequently present to, any scientific notation > is just unacceptable. You can add quantifiers (like KBps, MBps, > GBps), but presenting something a 5e+5 Bps will just be lost. You > *might* get away with e+3, e+6, and e+9, but never the other e's. Where I come from (Europe) 9,000,000 means 9.0 and 9.000.000 means what you mean. That is why there is an international standard of having 9 000 000. Basically these things should be tunable through simple rc options. As to the point that different rc options can produce different results on different machines, as far as I am aware, all options can be overridden in the script itself (correct me if I am wrong?). Best regards, John
On Saturday 16 December 2006 19:42, Xavier Gnata wrote: > Hi, > > Each time I'm working on C++ codes using vector or valarray, I would > like to be able to plot them. > The problem is that there is no straitforward way to do that in C++. > My goal is not to code a QT or GTK application but only to be able to > plot 1D and 2D things from one given large C++ code without having to > add lots of lines of codes in my code (let say it is intend to be used > in debug phase). > > Questions : > Is there a way to call pylab plot and imshow from a C++ code ? > In this case, I do not care if we have to copy the array and it can be > slow. It would be a so nice feature to debug C++ image processing codes. > Any example of code is welcome even they are not calling matplotlib but > anthing else in python. > > Xavier. > ps : In my codes, 2D images are stored as in a class derived from > valarray (1D array) adding the size of the image along the 2 directions > as private members. Hi Xavier, you should really check out the Boost::Python libraries. They allow you, among other things, to expose your C++ container classes as python objects. I'm using them heavily in my project and I'm very satisfied. Check them out here: http://www.boost.org/libs/python/doc/ HTH, Francesco
It really depends on your audience as to whether or not 1,000,000 through 9,000,000 is better displayed in scientific notation or not. For audiences that I frequently present to, any scientific notation is just unacceptable. You can add quantifiers (like KBps, MBps, GBps), but presenting something a 5e+5 Bps will just be lost. You *might* get away with e+3, e+6, and e+9, but never the other e's. On Dec 18, 2006, at 8:53 AM, Darren Dale wrote: > On Saturday 16 December 2006 20:00, Simson Garfinkel wrote: >> 1. I think that scientific notation should not be the default, unless >> numbers exceed 1E+7. > > There are good reasons to use scientific notation for smaller > numbers than > 10e+-7: We dont want neighboring tick labels to run into each other > on the x > axis, and we dont tick labels to run out of the window on the y > axis. For > examples, see the attachments at the bottom of this page: > http://sourceforge.net/tracker/index.php? > func=detail&aid=1196027&group_id=80706&atid=560720 > > Darren >