You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(33) |
Dec
(20) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(7) |
Feb
(44) |
Mar
(51) |
Apr
(43) |
May
(43) |
Jun
(36) |
Jul
(61) |
Aug
(44) |
Sep
(25) |
Oct
(82) |
Nov
(97) |
Dec
(47) |
2005 |
Jan
(77) |
Feb
(143) |
Mar
(42) |
Apr
(31) |
May
(93) |
Jun
(93) |
Jul
(35) |
Aug
(78) |
Sep
(56) |
Oct
(44) |
Nov
(72) |
Dec
(75) |
2006 |
Jan
(116) |
Feb
(99) |
Mar
(181) |
Apr
(171) |
May
(112) |
Jun
(86) |
Jul
(91) |
Aug
(111) |
Sep
(77) |
Oct
(72) |
Nov
(57) |
Dec
(51) |
2007 |
Jan
(64) |
Feb
(116) |
Mar
(70) |
Apr
(74) |
May
(53) |
Jun
(40) |
Jul
(519) |
Aug
(151) |
Sep
(132) |
Oct
(74) |
Nov
(282) |
Dec
(190) |
2008 |
Jan
(141) |
Feb
(67) |
Mar
(69) |
Apr
(96) |
May
(227) |
Jun
(404) |
Jul
(399) |
Aug
(96) |
Sep
(120) |
Oct
(205) |
Nov
(126) |
Dec
(261) |
2009 |
Jan
(136) |
Feb
(136) |
Mar
(119) |
Apr
(124) |
May
(155) |
Jun
(98) |
Jul
(136) |
Aug
(292) |
Sep
(174) |
Oct
(126) |
Nov
(126) |
Dec
(79) |
2010 |
Jan
(109) |
Feb
(83) |
Mar
(139) |
Apr
(91) |
May
(79) |
Jun
(164) |
Jul
(184) |
Aug
(146) |
Sep
(163) |
Oct
(128) |
Nov
(70) |
Dec
(73) |
2011 |
Jan
(235) |
Feb
(165) |
Mar
(147) |
Apr
(86) |
May
(74) |
Jun
(118) |
Jul
(65) |
Aug
(75) |
Sep
(162) |
Oct
(94) |
Nov
(48) |
Dec
(44) |
2012 |
Jan
(49) |
Feb
(40) |
Mar
(88) |
Apr
(35) |
May
(52) |
Jun
(69) |
Jul
(90) |
Aug
(123) |
Sep
(112) |
Oct
(120) |
Nov
(105) |
Dec
(116) |
2013 |
Jan
(76) |
Feb
(26) |
Mar
(78) |
Apr
(43) |
May
(61) |
Jun
(53) |
Jul
(147) |
Aug
(85) |
Sep
(83) |
Oct
(122) |
Nov
(18) |
Dec
(27) |
2014 |
Jan
(58) |
Feb
(25) |
Mar
(49) |
Apr
(17) |
May
(29) |
Jun
(39) |
Jul
(53) |
Aug
(52) |
Sep
(35) |
Oct
(47) |
Nov
(110) |
Dec
(27) |
2015 |
Jan
(50) |
Feb
(93) |
Mar
(96) |
Apr
(30) |
May
(55) |
Jun
(83) |
Jul
(44) |
Aug
(8) |
Sep
(5) |
Oct
|
Nov
(1) |
Dec
(1) |
2016 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(3) |
Sep
(1) |
Oct
(3) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
(7) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Benjamin R. <ben...@ou...> - 2012-07-18 22:15:28
|
Also, if desired, we could also set a different time. On Wed, Jul 18, 2012 at 5:11 PM, Benjamin Root <ben...@ou...> wrote: > technically, there is supposed to be a BOF about now, but I just realized > that no location was specified. We could meet in the atrium unless anyone > has a better idea. > > Ben > |
From: Benjamin R. <ben...@ou...> - 2012-07-18 22:12:10
|
technically, there is supposed to be a BOF about now, but I just realized that no location was specified. We could meet in the atrium unless anyone has a better idea. Ben |
From: Phil E. <pel...@gm...> - 2012-07-18 19:30:45
|
Ben, actually the PyQt4 backend is responsible for this (a hello world pyqt4 application doesn't accept sigint). However, I have fixed master (in the aforementioned PR) so that ctrl+c from the command line actually closes the figure. HTH, On 18 July 2012 20:00, Benjamin Root <ben...@ou...> wrote: > > > On Wed, Jul 18, 2012 at 1:40 PM, Neal Becker <ndb...@gm...> wrote: >> >> OK, my mistake. I'm using 1.1.1rc2. >> >> I was using a new installation without any matplotlibrc, and was defaulted >> to >> gtk. >> >> If I set: >> backend : Qt4Agg >> >> then the problem has returned. >> > > Usually, the source of such problems is someone using a bare try...except. > KeyboardInterrupt subclasses BaseException. There is a subtle difference > between > > try: > foo() > except: > pass > > and > > try: > foo() > except Exception: > pass > > The first will capture Ctrl-C and throw it away, while the latter will not. > PEP8 recommends against blind usage of bare except clauses. > > Happy hunting! > Ben Root > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > |
From: Neal B. <ndb...@gm...> - 2012-07-18 19:28:24
|
I'm afraid it's only an annoyance, and I doubt I'll be motivate to try to hunt that down. Benjamin Root wrote: > On Wed, Jul 18, 2012 at 1:40 PM, Neal Becker > <ndb...@gm...> wrote: > >> OK, my mistake. I'm using 1.1.1rc2. >> >> I was using a new installation without any matplotlibrc, and was defaulted >> to >> gtk. >> >> If I set: >> backend : Qt4Agg >> >> then the problem has returned. >> >> > Usually, the source of such problems is someone using a bare try...except. > KeyboardInterrupt subclasses BaseException. There is a subtle difference > between > > try: > foo() > except: > pass > > and > > try: > foo() > except Exception: > pass > > The first will capture Ctrl-C and throw it away, while the latter will > not. PEP8 recommends against blind usage of bare except clauses. > > Happy hunting! > Ben Root |
From: Benjamin R. <ben...@ou...> - 2012-07-18 19:00:33
|
On Wed, Jul 18, 2012 at 1:40 PM, Neal Becker <ndb...@gm...> wrote: > OK, my mistake. I'm using 1.1.1rc2. > > I was using a new installation without any matplotlibrc, and was defaulted > to > gtk. > > If I set: > backend : Qt4Agg > > then the problem has returned. > > Usually, the source of such problems is someone using a bare try...except. KeyboardInterrupt subclasses BaseException. There is a subtle difference between try: foo() except: pass and try: foo() except Exception: pass The first will capture Ctrl-C and throw it away, while the latter will not. PEP8 recommends against blind usage of bare except clauses. Happy hunting! Ben Root |
From: Neal B. <ndb...@gm...> - 2012-07-18 18:40:56
|
OK, my mistake. I'm using 1.1.1rc2. I was using a new installation without any matplotlibrc, and was defaulted to gtk. If I set: backend : Qt4Agg then the problem has returned. Phil Elson wrote: > Presumably you mean on the qt4 backend? If so, glad to be of some help! :-) > > The change came in in PR #851 > (https://github.com/matplotlib/matplotlib/pull/851/files#diff-7) and > also allows you to close a figure with ctrl+w and make a qt4 figure > fullscreen with "ctrl+f" (actually, just "f" will do, but I have an > ambition to nuke the non-controled versions by default). > > > UPDATE: I've just noticed that your traceback is showing your backend > as gtk, for which I cannot take any credit (nor do I know the change > which caused this improvement). > > > > On 18 July 2012 13:06, Neal Becker > <ndb...@gm...> wrote: >> One annoyance with mpl in the past is that when running a script, SIGINT >> would not kill it (needed to use C-c C-\ instead). >> >> It seems this is now fixed: >> >> Interrupt now gives me: >> >> File "/home/nbecker/.local/lib/python2.7/site- >> packages/matplotlib/backends/backend_gtk.py", line 77, in mainloop >> gtk.main() >> KeyboardInterrupt >> >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> Matplotlib-devel mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ |
From: Phil E. <pel...@gm...> - 2012-07-18 18:28:15
|
Presumably you mean on the qt4 backend? If so, glad to be of some help! :-) The change came in in PR #851 (https://github.com/matplotlib/matplotlib/pull/851/files#diff-7) and also allows you to close a figure with ctrl+w and make a qt4 figure fullscreen with "ctrl+f" (actually, just "f" will do, but I have an ambition to nuke the non-controled versions by default). UPDATE: I've just noticed that your traceback is showing your backend as gtk, for which I cannot take any credit (nor do I know the change which caused this improvement). On 18 July 2012 13:06, Neal Becker <ndb...@gm...> wrote: > One annoyance with mpl in the past is that when running a script, SIGINT would > not kill it (needed to use C-c C-\ instead). > > It seems this is now fixed: > > Interrupt now gives me: > > File "/home/nbecker/.local/lib/python2.7/site- > packages/matplotlib/backends/backend_gtk.py", line 77, in mainloop > gtk.main() > KeyboardInterrupt > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel |
From: Neal B. <ndb...@gm...> - 2012-07-18 12:07:23
|
One annoyance with mpl in the past is that when running a script, SIGINT would not kill it (needed to use C-c C-\ instead). It seems this is now fixed: Interrupt now gives me: File "/home/nbecker/.local/lib/python2.7/site- packages/matplotlib/backends/backend_gtk.py", line 77, in mainloop gtk.main() KeyboardInterrupt |
From: Damon M. <dam...@gm...> - 2012-07-17 14:28:40
|
On Tue, Jul 17, 2012 at 08:21:50AM -0500, Benjamin Root wrote: > On Tue, Jul 17, 2012 at 6:25 AM, todd rme <tod...@gm...> wrote: > > > On Wed, Jul 11, 2012 at 5:23 PM, John Hunter <jd...@gm...> wrote: > > > > > > > > > On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall > > > <dam...@gm...> wrote: > > >> > > >> Well, as Ben said, that error fill plot is neato! It doesn't look too > > >> complicated, either. I'd be more than happy to port it over later today > > >> when I get bored of typing up my thesis. It'll probably only take me > > >> about 30 minutes. > > >> > > >> If nobody is opposed to this idea, I'll go ahead and submit a PR this > > >> evening (British Summer (hah!) Time). > > > > > > > > > > > > While it is a nice graph, I am not sure that the use case is common > > enough > > > to justify a new plotting method. One can get the same result with: > > > > > > > > > In [68]: x = np.linspace(0, 2 * np.pi) > > > > > > In [69]: y_sin = np.sin(x) > > > > > > In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2]) > > > > > > In [71]: plot(x, y_sin) > > > Out[71]: [<matplotlib.lines.Line2D object at 0x96959ec>] > > > > > > In [72]: fill_between(np.concatenate([x, x[::-1]]), err, > > facecolor='red', > > > alpha=0.5) > > > Out[72]: <matplotlib.collections.PolyCollection object at 0x962758c> > > > > > > Admittedly the [::-1] thing is a bit counter-intuitive, but rather than > > > adding a new plotting method, perhaps we would be better off with a > > helper > > > method to create the xs and ys for fill_between > > > > > > xs, ys = mlab.pad_line(x, y, 0.2) > > > fill_between(xs, ys) > > > > > > JDH > > > > What about adding a property to the existing errorbar to let someone > > change it to the filled version? This could also, potentially, be > > extended with other types of error bars if the need arises. > > > > -Todd > > > > Intriguing idea. I am actually quite comfortable with that. > I like this idea, too. > Ben Root -- Damon McDougall http://damon-is-a-geek.com B2.39 Mathematics Institute University of Warwick Coventry West Midlands CV4 7AL United Kingdom |
From: Benjamin R. <ben...@ou...> - 2012-07-17 13:22:20
|
On Tue, Jul 17, 2012 at 6:25 AM, todd rme <tod...@gm...> wrote: > On Wed, Jul 11, 2012 at 5:23 PM, John Hunter <jd...@gm...> wrote: > > > > > > On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall > > <dam...@gm...> wrote: > >> > >> Well, as Ben said, that error fill plot is neato! It doesn't look too > >> complicated, either. I'd be more than happy to port it over later today > >> when I get bored of typing up my thesis. It'll probably only take me > >> about 30 minutes. > >> > >> If nobody is opposed to this idea, I'll go ahead and submit a PR this > >> evening (British Summer (hah!) Time). > > > > > > > > While it is a nice graph, I am not sure that the use case is common > enough > > to justify a new plotting method. One can get the same result with: > > > > > > In [68]: x = np.linspace(0, 2 * np.pi) > > > > In [69]: y_sin = np.sin(x) > > > > In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2]) > > > > In [71]: plot(x, y_sin) > > Out[71]: [<matplotlib.lines.Line2D object at 0x96959ec>] > > > > In [72]: fill_between(np.concatenate([x, x[::-1]]), err, > facecolor='red', > > alpha=0.5) > > Out[72]: <matplotlib.collections.PolyCollection object at 0x962758c> > > > > Admittedly the [::-1] thing is a bit counter-intuitive, but rather than > > adding a new plotting method, perhaps we would be better off with a > helper > > method to create the xs and ys for fill_between > > > > xs, ys = mlab.pad_line(x, y, 0.2) > > fill_between(xs, ys) > > > > JDH > > What about adding a property to the existing errorbar to let someone > change it to the filled version? This could also, potentially, be > extended with other types of error bars if the need arises. > > -Todd > Intriguing idea. I am actually quite comfortable with that. Ben Root |
From: todd r. <tod...@gm...> - 2012-07-17 11:25:46
|
On Wed, Jul 11, 2012 at 5:23 PM, John Hunter <jd...@gm...> wrote: > > > On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall > <dam...@gm...> wrote: >> >> Well, as Ben said, that error fill plot is neato! It doesn't look too >> complicated, either. I'd be more than happy to port it over later today >> when I get bored of typing up my thesis. It'll probably only take me >> about 30 minutes. >> >> If nobody is opposed to this idea, I'll go ahead and submit a PR this >> evening (British Summer (hah!) Time). > > > > While it is a nice graph, I am not sure that the use case is common enough > to justify a new plotting method. One can get the same result with: > > > In [68]: x = np.linspace(0, 2 * np.pi) > > In [69]: y_sin = np.sin(x) > > In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2]) > > In [71]: plot(x, y_sin) > Out[71]: [<matplotlib.lines.Line2D object at 0x96959ec>] > > In [72]: fill_between(np.concatenate([x, x[::-1]]), err, facecolor='red', > alpha=0.5) > Out[72]: <matplotlib.collections.PolyCollection object at 0x962758c> > > Admittedly the [::-1] thing is a bit counter-intuitive, but rather than > adding a new plotting method, perhaps we would be better off with a helper > method to create the xs and ys for fill_between > > xs, ys = mlab.pad_line(x, y, 0.2) > fill_between(xs, ys) > > JDH What about adding a property to the existing errorbar to let someone change it to the filled version? This could also, potentially, be extended with other types of error bars if the need arises. -Todd |
From: Benjamin R. <ben...@ou...> - 2012-07-14 01:56:53
|
On Fri, Jul 13, 2012 at 7:01 PM, Damon McDougall <dam...@gm...>wrote: > On Wed, Jul 11, 2012 at 08:33:21PM -0400, Tony Yu wrote: > > On Wed, Jul 11, 2012 at 2:28 PM, Benjamin Root <ben...@ou...> wrote: > > > > > > > > > > > On Wed, Jul 11, 2012 at 11:23 AM, John Hunter <jd...@gm...> > wrote: > > > > > >> > > >> > > >> On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall < > > >> dam...@gm...> wrote: > > >>> > > >>> Well, as Ben said, that error fill plot is neato! It doesn't look too > > >>> complicated, either. I'd be more than happy to port it over later > today > > >>> when I get bored of typing up my thesis. It'll probably only take me > > >>> about 30 minutes. > > >>> > > >>> If nobody is opposed to this idea, I'll go ahead and submit a PR this > > >>> evening (British Summer (hah!) Time). > > >>> > > >> > > >> > > >> While it is a nice graph, I am not sure that the use case is common > > >> enough to justify a new plotting method. One can get the same result > with: > > >> > > >> > > >> In [68]: x = np.linspace(0, 2 * np.pi) > > >> > > >> In [69]: y_sin = np.sin(x) > > >> > > >> In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2]) > > >> > > >> In [71]: plot(x, y_sin) > > >> Out[71]: [<matplotlib.lines.Line2D object at 0x96959ec>] > > >> > > >> In [72]: fill_between(np.concatenate([x, x[::-1]]), err, > > >> facecolor='red', alpha=0.5) > > >> Out[72]: <matplotlib.collections.PolyCollection object at 0x962758c> > > >> > > >> Admittedly the [::-1] thing is a bit counter-intuitive, but rather > than > > >> adding a new plotting method, perhaps we would be better off with a > helper > > >> method to create the xs and ys for fill_between > > >> > > >> xs, ys = mlab.pad_line(x, y, 0.2) > > >> fill_between(xs, ys) > > >> > > >> JDH > > >> > > > > > > > > > I could definitely agree with a pad_line() function. We might want to > > > revisit the issue of how much visibility the mlab module should get in > the > > > documentation (it currently doesn't get much at all). My whole take on > > > mlab was that it was a left-over from the days of working around > issues in > > > NumPy and SciPy and that it was being slowly phased out. As for other > > > possible locations, cbook feels like it is more for the devs than for > the > > > users, and adding it to pyplot would render the whole purpose of > creating > > > this function as opposed to errorfill moot. > > > > > > As an additional point about such a pad_line function, it should > probably > > > be nice to mirror the errorbar() functionality to allow not only a > constant > > > error, but also a N, Nx1, or 2xN array of +/- error. (note that > errorbar() > > > for the 2xN array case does -row1 and +row2). > > > > > > > Damon: it sounds like you're volunteering to submit a PR to add this > > function ;) > > > > Here's the relevant bit (which should already handle the cases Ben > mentions > > above): > > > > > > > https://github.com/tonysyu/mpltools/blob/master/mpltools/special/errorfill.py#L54 > > > > Great. I've basically done this. I have one suggestion, though. In the > case where len(zerr) == 2, you are setting > > zmin, zmax = zerr > > I think it makes more sense to set > > zmin, zmax = z - zerr[0], z + zerr[1] > > What do you think? > Your suggestion would be consistent with how errorbar() works, I think. Ben Root |
From: Damon M. <dam...@gm...> - 2012-07-13 23:01:53
|
On Wed, Jul 11, 2012 at 08:33:21PM -0400, Tony Yu wrote: > On Wed, Jul 11, 2012 at 2:28 PM, Benjamin Root <ben...@ou...> wrote: > > > > > > > On Wed, Jul 11, 2012 at 11:23 AM, John Hunter <jd...@gm...> wrote: > > > >> > >> > >> On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall < > >> dam...@gm...> wrote: > >>> > >>> Well, as Ben said, that error fill plot is neato! It doesn't look too > >>> complicated, either. I'd be more than happy to port it over later today > >>> when I get bored of typing up my thesis. It'll probably only take me > >>> about 30 minutes. > >>> > >>> If nobody is opposed to this idea, I'll go ahead and submit a PR this > >>> evening (British Summer (hah!) Time). > >>> > >> > >> > >> While it is a nice graph, I am not sure that the use case is common > >> enough to justify a new plotting method. One can get the same result with: > >> > >> > >> In [68]: x = np.linspace(0, 2 * np.pi) > >> > >> In [69]: y_sin = np.sin(x) > >> > >> In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2]) > >> > >> In [71]: plot(x, y_sin) > >> Out[71]: [<matplotlib.lines.Line2D object at 0x96959ec>] > >> > >> In [72]: fill_between(np.concatenate([x, x[::-1]]), err, > >> facecolor='red', alpha=0.5) > >> Out[72]: <matplotlib.collections.PolyCollection object at 0x962758c> > >> > >> Admittedly the [::-1] thing is a bit counter-intuitive, but rather than > >> adding a new plotting method, perhaps we would be better off with a helper > >> method to create the xs and ys for fill_between > >> > >> xs, ys = mlab.pad_line(x, y, 0.2) > >> fill_between(xs, ys) > >> > >> JDH > >> > > > > > > I could definitely agree with a pad_line() function. We might want to > > revisit the issue of how much visibility the mlab module should get in the > > documentation (it currently doesn't get much at all). My whole take on > > mlab was that it was a left-over from the days of working around issues in > > NumPy and SciPy and that it was being slowly phased out. As for other > > possible locations, cbook feels like it is more for the devs than for the > > users, and adding it to pyplot would render the whole purpose of creating > > this function as opposed to errorfill moot. > > > > As an additional point about such a pad_line function, it should probably > > be nice to mirror the errorbar() functionality to allow not only a constant > > error, but also a N, Nx1, or 2xN array of +/- error. (note that errorbar() > > for the 2xN array case does -row1 and +row2). > > > > Damon: it sounds like you're volunteering to submit a PR to add this > function ;) > > Here's the relevant bit (which should already handle the cases Ben mentions > above): > > > https://github.com/tonysyu/mpltools/blob/master/mpltools/special/errorfill.py#L54 > Great. I've basically done this. I have one suggestion, though. In the case where len(zerr) == 2, you are setting zmin, zmax = zerr I think it makes more sense to set zmin, zmax = z - zerr[0], z + zerr[1] What do you think? > It needs a docstring and a home (pyplot.py?). I kind of think `offset_line` > is more explicit than `pad_line` (both of these are *much* better than my > original `extrema_from_error_input`). > > Cheers, > -Tony > > > > Cheers! > > Ben Root > > > > Best, Damon -- Damon McDougall http://damon-is-a-geek.com B2.39 Mathematics Institute University of Warwick Coventry West Midlands CV4 7AL United Kingdom |
From: John H. <jd...@gm...> - 2012-07-13 13:11:07
|
On Jul 13, 2012, at 7:57 AM, Benjamin Root <ben...@ou...> wrote: > There was talk of this living in mlab or cbook. Is there a preference? > > > Neither. cbook is really meant more for the devs. Half of it is converter functions that are probably completely unneeded now, while the other half is the callback registry. I disagree that cbook is meant for devs. I initially used cbook as a place to put neat recipes from the python cookbook. It has grown a bit from there. The stuff that is in there like "is_string_like" is generically useful. The converters are used by the rec2* funcs, eg the rec2excel function in the exceltools toolkit. I use these extensively. > Luckily, the module is called "cbook.py", so one could pretend that it isn't "cookbook" but rather "callback book"... > > Meanwhile, mlab's own documentation says: "Numerical python functions written for compatability with MATLAB > commands with the same names." So, unless someone can find out if MATLAB has some sort of equivalent functionality hidden away somewhere, it doesn't belong there either. > Or better, we change the docstring. I think of mlab as a place to put numerical or semi-numerical stuff in support of plotting. > Not sure where to put it. mlab is probably the best place. |
From: Benjamin R. <ben...@ou...> - 2012-07-13 12:58:26
|
On Thu, Jul 12, 2012 at 3:33 PM, Damon McDougall <dam...@gm...>wrote: > On Wed, Jul 11, 2012 at 08:33:21PM -0400, Tony Yu wrote: > > On Wed, Jul 11, 2012 at 2:28 PM, Benjamin Root <ben...@ou...> wrote: > > > > > > > > > > > On Wed, Jul 11, 2012 at 11:23 AM, John Hunter <jd...@gm...> > wrote: > > > > > >> > > >> > > >> On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall < > > >> dam...@gm...> wrote: > > >>> > > >>> Well, as Ben said, that error fill plot is neato! It doesn't look too > > >>> complicated, either. I'd be more than happy to port it over later > today > > >>> when I get bored of typing up my thesis. It'll probably only take me > > >>> about 30 minutes. > > >>> > > >>> If nobody is opposed to this idea, I'll go ahead and submit a PR this > > >>> evening (British Summer (hah!) Time). > > >>> > > >> > > >> > > >> While it is a nice graph, I am not sure that the use case is common > > >> enough to justify a new plotting method. One can get the same result > with: > > >> > > >> > > >> In [68]: x = np.linspace(0, 2 * np.pi) > > >> > > >> In [69]: y_sin = np.sin(x) > > >> > > >> In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2]) > > >> > > >> In [71]: plot(x, y_sin) > > >> Out[71]: [<matplotlib.lines.Line2D object at 0x96959ec>] > > >> > > >> In [72]: fill_between(np.concatenate([x, x[::-1]]), err, > > >> facecolor='red', alpha=0.5) > > >> Out[72]: <matplotlib.collections.PolyCollection object at 0x962758c> > > >> > > >> Admittedly the [::-1] thing is a bit counter-intuitive, but rather > than > > >> adding a new plotting method, perhaps we would be better off with a > helper > > >> method to create the xs and ys for fill_between > > >> > > >> xs, ys = mlab.pad_line(x, y, 0.2) > > >> fill_between(xs, ys) > > >> > > >> JDH > > >> > > > > > > > > > I could definitely agree with a pad_line() function. We might want to > > > revisit the issue of how much visibility the mlab module should get in > the > > > documentation (it currently doesn't get much at all). My whole take on > > > mlab was that it was a left-over from the days of working around > issues in > > > NumPy and SciPy and that it was being slowly phased out. As for other > > > possible locations, cbook feels like it is more for the devs than for > the > > > users, and adding it to pyplot would render the whole purpose of > creating > > > this function as opposed to errorfill moot. > > > > > > As an additional point about such a pad_line function, it should > probably > > > be nice to mirror the errorbar() functionality to allow not only a > constant > > > error, but also a N, Nx1, or 2xN array of +/- error. (note that > errorbar() > > > for the 2xN array case does -row1 and +row2). > > > > > > > Damon: it sounds like you're volunteering to submit a PR to add this > > function ;) > > > > Here's the relevant bit (which should already handle the cases Ben > mentions > > above): > > > > > > > https://github.com/tonysyu/mpltools/blob/master/mpltools/special/errorfill.py#L54 > > > > It needs a docstring and a home (pyplot.py?). I kind of think > `offset_line` > > is more explicit than `pad_line` (both of these are *much* better than my > > original `extrema_from_error_input`). > > > > There was talk of this living in mlab or cbook. Is there a preference? > > Neither. cbook is really meant more for the devs. Half of it is converter functions that are probably completely unneeded now, while the other half is the callback registry. Luckily, the module is called "cbook.py", so one could pretend that it isn't "cookbook" but rather "callback book"... Meanwhile, mlab's own documentation says: "Numerical python functions written for compatability with MATLAB commands with the same names." So, unless someone can find out if MATLAB has some sort of equivalent functionality hidden away somewhere, it doesn't belong there either. Not sure where to put it. Cheers! Ben Root |
From: Damon M. <dam...@gm...> - 2012-07-12 19:33:30
|
On Wed, Jul 11, 2012 at 08:33:21PM -0400, Tony Yu wrote: > On Wed, Jul 11, 2012 at 2:28 PM, Benjamin Root <ben...@ou...> wrote: > > > > > > > On Wed, Jul 11, 2012 at 11:23 AM, John Hunter <jd...@gm...> wrote: > > > >> > >> > >> On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall < > >> dam...@gm...> wrote: > >>> > >>> Well, as Ben said, that error fill plot is neato! It doesn't look too > >>> complicated, either. I'd be more than happy to port it over later today > >>> when I get bored of typing up my thesis. It'll probably only take me > >>> about 30 minutes. > >>> > >>> If nobody is opposed to this idea, I'll go ahead and submit a PR this > >>> evening (British Summer (hah!) Time). > >>> > >> > >> > >> While it is a nice graph, I am not sure that the use case is common > >> enough to justify a new plotting method. One can get the same result with: > >> > >> > >> In [68]: x = np.linspace(0, 2 * np.pi) > >> > >> In [69]: y_sin = np.sin(x) > >> > >> In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2]) > >> > >> In [71]: plot(x, y_sin) > >> Out[71]: [<matplotlib.lines.Line2D object at 0x96959ec>] > >> > >> In [72]: fill_between(np.concatenate([x, x[::-1]]), err, > >> facecolor='red', alpha=0.5) > >> Out[72]: <matplotlib.collections.PolyCollection object at 0x962758c> > >> > >> Admittedly the [::-1] thing is a bit counter-intuitive, but rather than > >> adding a new plotting method, perhaps we would be better off with a helper > >> method to create the xs and ys for fill_between > >> > >> xs, ys = mlab.pad_line(x, y, 0.2) > >> fill_between(xs, ys) > >> > >> JDH > >> > > > > > > I could definitely agree with a pad_line() function. We might want to > > revisit the issue of how much visibility the mlab module should get in the > > documentation (it currently doesn't get much at all). My whole take on > > mlab was that it was a left-over from the days of working around issues in > > NumPy and SciPy and that it was being slowly phased out. As for other > > possible locations, cbook feels like it is more for the devs than for the > > users, and adding it to pyplot would render the whole purpose of creating > > this function as opposed to errorfill moot. > > > > As an additional point about such a pad_line function, it should probably > > be nice to mirror the errorbar() functionality to allow not only a constant > > error, but also a N, Nx1, or 2xN array of +/- error. (note that errorbar() > > for the 2xN array case does -row1 and +row2). > > > > Damon: it sounds like you're volunteering to submit a PR to add this > function ;) > > Here's the relevant bit (which should already handle the cases Ben mentions > above): > > > https://github.com/tonysyu/mpltools/blob/master/mpltools/special/errorfill.py#L54 > > It needs a docstring and a home (pyplot.py?). I kind of think `offset_line` > is more explicit than `pad_line` (both of these are *much* better than my > original `extrema_from_error_input`). > There was talk of this living in mlab or cbook. Is there a preference? > Cheers, > -Tony > > > > Cheers! > > Ben Root > > > > -- Damon McDougall http://damon-is-a-geek.com B2.39 Mathematics Institute University of Warwick Coventry West Midlands CV4 7AL United Kingdom |
From: Damon M. <dam...@gm...> - 2012-07-12 13:45:31
|
On Thu, Jul 12, 2012 at 09:41:32AM -0400, Tony Yu wrote: > On Thu, Jul 12, 2012 at 9:28 AM, Damon McDougall > <dam...@gm...>wrote: > > > On Wed, Jul 11, 2012 at 08:33:21PM -0400, Tony Yu wrote: > > > On Wed, Jul 11, 2012 at 2:28 PM, Benjamin Root <ben...@ou...> wrote: > > > > > > > > > > > > > > > On Wed, Jul 11, 2012 at 11:23 AM, John Hunter <jd...@gm...> > > wrote: > > > > > > > >> > > > >> > > > >> On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall < > > > >> dam...@gm...> wrote: > > > >>> > > > >>> Well, as Ben said, that error fill plot is neato! It doesn't look too > > > >>> complicated, either. I'd be more than happy to port it over later > > today > > > >>> when I get bored of typing up my thesis. It'll probably only take me > > > >>> about 30 minutes. > > > >>> > > > >>> If nobody is opposed to this idea, I'll go ahead and submit a PR this > > > >>> evening (British Summer (hah!) Time). > > > >>> > > > >> > > > >> > > > >> While it is a nice graph, I am not sure that the use case is common > > > >> enough to justify a new plotting method. One can get the same result > > with: > > > >> > > > >> > > > >> In [68]: x = np.linspace(0, 2 * np.pi) > > > >> > > > >> In [69]: y_sin = np.sin(x) > > > >> > > > >> In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2]) > > > >> > > > >> In [71]: plot(x, y_sin) > > > >> Out[71]: [<matplotlib.lines.Line2D object at 0x96959ec>] > > > >> > > > >> In [72]: fill_between(np.concatenate([x, x[::-1]]), err, > > > >> facecolor='red', alpha=0.5) > > > >> Out[72]: <matplotlib.collections.PolyCollection object at 0x962758c> > > > >> > > > >> Admittedly the [::-1] thing is a bit counter-intuitive, but rather > > than > > > >> adding a new plotting method, perhaps we would be better off with a > > helper > > > >> method to create the xs and ys for fill_between > > > >> > > > >> xs, ys = mlab.pad_line(x, y, 0.2) > > > >> fill_between(xs, ys) > > > >> > > > >> JDH > > > >> > > > > > > > > > > > > I could definitely agree with a pad_line() function. We might want to > > > > revisit the issue of how much visibility the mlab module should get in > > the > > > > documentation (it currently doesn't get much at all). My whole take on > > > > mlab was that it was a left-over from the days of working around > > issues in > > > > NumPy and SciPy and that it was being slowly phased out. As for other > > > > possible locations, cbook feels like it is more for the devs than for > > the > > > > users, and adding it to pyplot would render the whole purpose of > > creating > > > > this function as opposed to errorfill moot. > > > > > > > > As an additional point about such a pad_line function, it should > > probably > > > > be nice to mirror the errorbar() functionality to allow not only a > > constant > > > > error, but also a N, Nx1, or 2xN array of +/- error. (note that > > errorbar() > > > > for the 2xN array case does -row1 and +row2). > > > > > > > > > > Damon: it sounds like you're volunteering to submit a PR to add this > > > function ;) > > > > > > Here's the relevant bit (which should already handle the cases Ben > > mentions > > > above): > > > > > > > > > > > https://github.com/tonysyu/mpltools/blob/master/mpltools/special/errorfill.py#L54 > > > > > > It needs a docstring and a home (pyplot.py?). I kind of think > > `offset_line` > > > is more explicit than `pad_line` (both of these are *much* better than my > > > original `extrema_from_error_input`). > > > > > > Cheers, > > > -Tony > > > > > > > > > > Cheers! > > > > Ben Root > > > > > > > > > > > > Woohoo! Something other than my thesis to do! I have one question. It > > looks like your function `extrema_from_error_input` just adds +/- an > > error scalar (or array), but in the gallery it looks like the padding > > is thinner in the areas of the `sin` function where the magnitude of the > > gradient is larger. Is this the case, or am I missing something? > > > > -- > > Damon McDougall > > > > > Yep, that's the way it should look because it's adding the error just in > the y-direction. To get a constant thickness, you'd have to add a constant > orthogonal to the line's slope. > > Good luck procrastinating on your thesis ;) > -Tony Aha, the answer was 'yes, I was missing something'! :) Thanks. -- Damon McDougall http://damon-is-a-geek.com B2.39 Mathematics Institute University of Warwick Coventry West Midlands CV4 7AL United Kingdom |
From: Tony Yu <ts...@gm...> - 2012-07-12 13:42:25
|
On Thu, Jul 12, 2012 at 9:28 AM, Damon McDougall <dam...@gm...>wrote: > On Wed, Jul 11, 2012 at 08:33:21PM -0400, Tony Yu wrote: > > On Wed, Jul 11, 2012 at 2:28 PM, Benjamin Root <ben...@ou...> wrote: > > > > > > > > > > > On Wed, Jul 11, 2012 at 11:23 AM, John Hunter <jd...@gm...> > wrote: > > > > > >> > > >> > > >> On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall < > > >> dam...@gm...> wrote: > > >>> > > >>> Well, as Ben said, that error fill plot is neato! It doesn't look too > > >>> complicated, either. I'd be more than happy to port it over later > today > > >>> when I get bored of typing up my thesis. It'll probably only take me > > >>> about 30 minutes. > > >>> > > >>> If nobody is opposed to this idea, I'll go ahead and submit a PR this > > >>> evening (British Summer (hah!) Time). > > >>> > > >> > > >> > > >> While it is a nice graph, I am not sure that the use case is common > > >> enough to justify a new plotting method. One can get the same result > with: > > >> > > >> > > >> In [68]: x = np.linspace(0, 2 * np.pi) > > >> > > >> In [69]: y_sin = np.sin(x) > > >> > > >> In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2]) > > >> > > >> In [71]: plot(x, y_sin) > > >> Out[71]: [<matplotlib.lines.Line2D object at 0x96959ec>] > > >> > > >> In [72]: fill_between(np.concatenate([x, x[::-1]]), err, > > >> facecolor='red', alpha=0.5) > > >> Out[72]: <matplotlib.collections.PolyCollection object at 0x962758c> > > >> > > >> Admittedly the [::-1] thing is a bit counter-intuitive, but rather > than > > >> adding a new plotting method, perhaps we would be better off with a > helper > > >> method to create the xs and ys for fill_between > > >> > > >> xs, ys = mlab.pad_line(x, y, 0.2) > > >> fill_between(xs, ys) > > >> > > >> JDH > > >> > > > > > > > > > I could definitely agree with a pad_line() function. We might want to > > > revisit the issue of how much visibility the mlab module should get in > the > > > documentation (it currently doesn't get much at all). My whole take on > > > mlab was that it was a left-over from the days of working around > issues in > > > NumPy and SciPy and that it was being slowly phased out. As for other > > > possible locations, cbook feels like it is more for the devs than for > the > > > users, and adding it to pyplot would render the whole purpose of > creating > > > this function as opposed to errorfill moot. > > > > > > As an additional point about such a pad_line function, it should > probably > > > be nice to mirror the errorbar() functionality to allow not only a > constant > > > error, but also a N, Nx1, or 2xN array of +/- error. (note that > errorbar() > > > for the 2xN array case does -row1 and +row2). > > > > > > > Damon: it sounds like you're volunteering to submit a PR to add this > > function ;) > > > > Here's the relevant bit (which should already handle the cases Ben > mentions > > above): > > > > > > > https://github.com/tonysyu/mpltools/blob/master/mpltools/special/errorfill.py#L54 > > > > It needs a docstring and a home (pyplot.py?). I kind of think > `offset_line` > > is more explicit than `pad_line` (both of these are *much* better than my > > original `extrema_from_error_input`). > > > > Cheers, > > -Tony > > > > > > > Cheers! > > > Ben Root > > > > > > > > Woohoo! Something other than my thesis to do! I have one question. It > looks like your function `extrema_from_error_input` just adds +/- an > error scalar (or array), but in the gallery it looks like the padding > is thinner in the areas of the `sin` function where the magnitude of the > gradient is larger. Is this the case, or am I missing something? > > -- > Damon McDougall > Yep, that's the way it should look because it's adding the error just in the y-direction. To get a constant thickness, you'd have to add a constant orthogonal to the line's slope. Good luck procrastinating on your thesis ;) -Tony |
From: Damon M. <dam...@gm...> - 2012-07-12 13:28:21
|
On Wed, Jul 11, 2012 at 08:33:21PM -0400, Tony Yu wrote: > On Wed, Jul 11, 2012 at 2:28 PM, Benjamin Root <ben...@ou...> wrote: > > > > > > > On Wed, Jul 11, 2012 at 11:23 AM, John Hunter <jd...@gm...> wrote: > > > >> > >> > >> On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall < > >> dam...@gm...> wrote: > >>> > >>> Well, as Ben said, that error fill plot is neato! It doesn't look too > >>> complicated, either. I'd be more than happy to port it over later today > >>> when I get bored of typing up my thesis. It'll probably only take me > >>> about 30 minutes. > >>> > >>> If nobody is opposed to this idea, I'll go ahead and submit a PR this > >>> evening (British Summer (hah!) Time). > >>> > >> > >> > >> While it is a nice graph, I am not sure that the use case is common > >> enough to justify a new plotting method. One can get the same result with: > >> > >> > >> In [68]: x = np.linspace(0, 2 * np.pi) > >> > >> In [69]: y_sin = np.sin(x) > >> > >> In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2]) > >> > >> In [71]: plot(x, y_sin) > >> Out[71]: [<matplotlib.lines.Line2D object at 0x96959ec>] > >> > >> In [72]: fill_between(np.concatenate([x, x[::-1]]), err, > >> facecolor='red', alpha=0.5) > >> Out[72]: <matplotlib.collections.PolyCollection object at 0x962758c> > >> > >> Admittedly the [::-1] thing is a bit counter-intuitive, but rather than > >> adding a new plotting method, perhaps we would be better off with a helper > >> method to create the xs and ys for fill_between > >> > >> xs, ys = mlab.pad_line(x, y, 0.2) > >> fill_between(xs, ys) > >> > >> JDH > >> > > > > > > I could definitely agree with a pad_line() function. We might want to > > revisit the issue of how much visibility the mlab module should get in the > > documentation (it currently doesn't get much at all). My whole take on > > mlab was that it was a left-over from the days of working around issues in > > NumPy and SciPy and that it was being slowly phased out. As for other > > possible locations, cbook feels like it is more for the devs than for the > > users, and adding it to pyplot would render the whole purpose of creating > > this function as opposed to errorfill moot. > > > > As an additional point about such a pad_line function, it should probably > > be nice to mirror the errorbar() functionality to allow not only a constant > > error, but also a N, Nx1, or 2xN array of +/- error. (note that errorbar() > > for the 2xN array case does -row1 and +row2). > > > > Damon: it sounds like you're volunteering to submit a PR to add this > function ;) > > Here's the relevant bit (which should already handle the cases Ben mentions > above): > > > https://github.com/tonysyu/mpltools/blob/master/mpltools/special/errorfill.py#L54 > > It needs a docstring and a home (pyplot.py?). I kind of think `offset_line` > is more explicit than `pad_line` (both of these are *much* better than my > original `extrema_from_error_input`). > > Cheers, > -Tony > > > > Cheers! > > Ben Root > > > > Woohoo! Something other than my thesis to do! I have one question. It looks like your function `extrema_from_error_input` just adds +/- an error scalar (or array), but in the gallery it looks like the padding is thinner in the areas of the `sin` function where the magnitude of the gradient is larger. Is this the case, or am I missing something? -- Damon McDougall http://damon-is-a-geek.com B2.39 Mathematics Institute University of Warwick Coventry West Midlands CV4 7AL United Kingdom |
From: Tony Yu <ts...@gm...> - 2012-07-12 00:34:09
|
On Wed, Jul 11, 2012 at 2:28 PM, Benjamin Root <ben...@ou...> wrote: > > > On Wed, Jul 11, 2012 at 11:23 AM, John Hunter <jd...@gm...> wrote: > >> >> >> On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall < >> dam...@gm...> wrote: >>> >>> Well, as Ben said, that error fill plot is neato! It doesn't look too >>> complicated, either. I'd be more than happy to port it over later today >>> when I get bored of typing up my thesis. It'll probably only take me >>> about 30 minutes. >>> >>> If nobody is opposed to this idea, I'll go ahead and submit a PR this >>> evening (British Summer (hah!) Time). >>> >> >> >> While it is a nice graph, I am not sure that the use case is common >> enough to justify a new plotting method. One can get the same result with: >> >> >> In [68]: x = np.linspace(0, 2 * np.pi) >> >> In [69]: y_sin = np.sin(x) >> >> In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2]) >> >> In [71]: plot(x, y_sin) >> Out[71]: [<matplotlib.lines.Line2D object at 0x96959ec>] >> >> In [72]: fill_between(np.concatenate([x, x[::-1]]), err, >> facecolor='red', alpha=0.5) >> Out[72]: <matplotlib.collections.PolyCollection object at 0x962758c> >> >> Admittedly the [::-1] thing is a bit counter-intuitive, but rather than >> adding a new plotting method, perhaps we would be better off with a helper >> method to create the xs and ys for fill_between >> >> xs, ys = mlab.pad_line(x, y, 0.2) >> fill_between(xs, ys) >> >> JDH >> > > > I could definitely agree with a pad_line() function. We might want to > revisit the issue of how much visibility the mlab module should get in the > documentation (it currently doesn't get much at all). My whole take on > mlab was that it was a left-over from the days of working around issues in > NumPy and SciPy and that it was being slowly phased out. As for other > possible locations, cbook feels like it is more for the devs than for the > users, and adding it to pyplot would render the whole purpose of creating > this function as opposed to errorfill moot. > > As an additional point about such a pad_line function, it should probably > be nice to mirror the errorbar() functionality to allow not only a constant > error, but also a N, Nx1, or 2xN array of +/- error. (note that errorbar() > for the 2xN array case does -row1 and +row2). > Damon: it sounds like you're volunteering to submit a PR to add this function ;) Here's the relevant bit (which should already handle the cases Ben mentions above): https://github.com/tonysyu/mpltools/blob/master/mpltools/special/errorfill.py#L54 It needs a docstring and a home (pyplot.py?). I kind of think `offset_line` is more explicit than `pad_line` (both of these are *much* better than my original `extrema_from_error_input`). Cheers, -Tony > Cheers! > Ben Root > > |
From: Paul I. <piv...@gm...> - 2012-07-12 00:16:47
|
On Tue, Jul 10, 2012 at 8:06 PM, Benjamin Root <ben...@ou...> wrote: > On Tuesday, July 10, 2012, Mike Kaufman wrote: >> >> It would be nice to have the label and title methods take a Text object >> (and a list of text objects -- each of whom could supply a piece of >> different colored text) in addition to a string. >> >> A list of text objects would be automagically concatenated together. How >> to generalize alignment of multiple text objects? Haven't thought that >> far yet. >> >> Either that or develop some additional color markup (and a parser) >> inside a string. Admittedly a bigger project -- though probably a better >> solution. >> >> M >> > > That is already a wishlist item. Feel free to comment on its discussion > thread with your ideas. For reference, I believe Ben's referring to #697 [1], for which I provided a possible implementation, which has the automagic concatenation you seek. 1. https://github.com/matplotlib/matplotlib/issues/697 best, -- Paul Ivanov 314 address only used for lists, off-list direct email at: http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 |
From: Benjamin R. <ben...@ou...> - 2012-07-11 18:28:51
|
On Wed, Jul 11, 2012 at 11:23 AM, John Hunter <jd...@gm...> wrote: > > > On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall < > dam...@gm...> wrote: >> >> Well, as Ben said, that error fill plot is neato! It doesn't look too >> complicated, either. I'd be more than happy to port it over later today >> when I get bored of typing up my thesis. It'll probably only take me >> about 30 minutes. >> >> If nobody is opposed to this idea, I'll go ahead and submit a PR this >> evening (British Summer (hah!) Time). >> > > > While it is a nice graph, I am not sure that the use case is common enough > to justify a new plotting method. One can get the same result with: > > > In [68]: x = np.linspace(0, 2 * np.pi) > > In [69]: y_sin = np.sin(x) > > In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2]) > > In [71]: plot(x, y_sin) > Out[71]: [<matplotlib.lines.Line2D object at 0x96959ec>] > > In [72]: fill_between(np.concatenate([x, x[::-1]]), err, > facecolor='red', alpha=0.5) > Out[72]: <matplotlib.collections.PolyCollection object at 0x962758c> > > Admittedly the [::-1] thing is a bit counter-intuitive, but rather than > adding a new plotting method, perhaps we would be better off with a helper > method to create the xs and ys for fill_between > > xs, ys = mlab.pad_line(x, y, 0.2) > fill_between(xs, ys) > > JDH > I could definitely agree with a pad_line() function. We might want to revisit the issue of how much visibility the mlab module should get in the documentation (it currently doesn't get much at all). My whole take on mlab was that it was a left-over from the days of working around issues in NumPy and SciPy and that it was being slowly phased out. As for other possible locations, cbook feels like it is more for the devs than for the users, and adding it to pyplot would render the whole purpose of creating this function as opposed to errorfill moot. As an additional point about such a pad_line function, it should probably be nice to mirror the errorbar() functionality to allow not only a constant error, but also a N, Nx1, or 2xN array of +/- error. (note that errorbar() for the 2xN array case does -row1 and +row2). Cheers! Ben Root |
From: Damon M. <dam...@gm...> - 2012-07-11 17:53:24
|
On Wed, Jul 11, 2012 at 10:23:32AM -0500, John Hunter wrote: > On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall <dam...@gm... > > wrote: > > > > Well, as Ben said, that error fill plot is neato! It doesn't look too > > complicated, either. I'd be more than happy to port it over later today > > when I get bored of typing up my thesis. It'll probably only take me > > about 30 minutes. > > > > If nobody is opposed to this idea, I'll go ahead and submit a PR this > > evening (British Summer (hah!) Time). > > > > > While it is a nice graph, I am not sure that the use case is common enough > to justify a new plotting method. One can get the same result with: > > > In [68]: x = np.linspace(0, 2 * np.pi) > > In [69]: y_sin = np.sin(x) > > In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2]) > > In [71]: plot(x, y_sin) > Out[71]: [<matplotlib.lines.Line2D object at 0x96959ec>] > > In [72]: fill_between(np.concatenate([x, x[::-1]]), err, facecolor='red', > alpha=0.5) > Out[72]: <matplotlib.collections.PolyCollection object at 0x962758c> > > Admittedly the [::-1] thing is a bit counter-intuitive, but rather than > adding a new plotting method, perhaps we would be better off with a helper > method to create the xs and ys for fill_between > > xs, ys = mlab.pad_line(x, y, 0.2) > fill_between(xs, ys) > > JDH +1 on the helper function. That's probably a much less bloated of way of doing it. -- Damon McDougall http://damon-is-a-geek.com B2.39 Mathematics Institute University of Warwick Coventry West Midlands CV4 7AL United Kingdom |
From: Tony Yu <ts...@gm...> - 2012-07-11 17:12:23
|
On Wed, Jul 11, 2012 at 11:27 AM, Benjamin Root <ben...@ou...> wrote: > > > On Wed, Jul 11, 2012 at 11:23 AM, John Hunter <jd...@gm...> wrote: > >> >> >> On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall < >> dam...@gm...> wrote: >>> >>> Well, as Ben said, that error fill plot is neato! It doesn't look too >>> complicated, either. I'd be more than happy to port it over later today >>> when I get bored of typing up my thesis. It'll probably only take me >>> about 30 minutes. >>> >>> If nobody is opposed to this idea, I'll go ahead and submit a PR this >>> evening (British Summer (hah!) Time). >>> >> >> >> While it is a nice graph, I am not sure that the use case is common >> enough to justify a new plotting method. One can get the same result with: >> >> >> In [68]: x = np.linspace(0, 2 * np.pi) >> >> In [69]: y_sin = np.sin(x) >> >> In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2]) >> >> In [71]: plot(x, y_sin) >> Out[71]: [<matplotlib.lines.Line2D object at 0x96959ec>] >> >> In [72]: fill_between(np.concatenate([x, x[::-1]]), err, >> facecolor='red', alpha=0.5) >> Out[72]: <matplotlib.collections.PolyCollection object at 0x962758c> >> >> Admittedly the [::-1] thing is a bit counter-intuitive, but rather than >> adding a new plotting method, perhaps we would be better off with a helper >> method to create the xs and ys for fill_between >> >> xs, ys = mlab.pad_line(x, y, 0.2) >> fill_between(xs, ys) >> >> JDH >> > > At the very least, it should be added to the gallery. Also, one thing > that might (or might not) get in the way of getting merged into mainline > mpl is how well it interacts with legends. What does it produce in the > legend? > > Ben Root > > As I said before, it is a really simple function: I wrote `errorfill` just to get an interface that is somewhat similar to `errorbar`. I tend to think that the Axes object is a bit bloated, so I'm inclined to agree that it might be best leave it out of matplotlib-proper. +1 on the gallery, though. Ben: Good point about the legend-interaction. I just added a fix on github; here's the result: http://tonysyu.github.com/mpltools/auto_examples/special/plot_errorfill.html Cheers, -Tony |
From: Benjamin R. <ben...@ou...> - 2012-07-11 15:27:56
|
On Wed, Jul 11, 2012 at 11:23 AM, John Hunter <jd...@gm...> wrote: > > > On Wed, Jul 11, 2012 at 10:09 AM, Damon McDougall < > dam...@gm...> wrote: >> >> Well, as Ben said, that error fill plot is neato! It doesn't look too >> complicated, either. I'd be more than happy to port it over later today >> when I get bored of typing up my thesis. It'll probably only take me >> about 30 minutes. >> >> If nobody is opposed to this idea, I'll go ahead and submit a PR this >> evening (British Summer (hah!) Time). >> > > > While it is a nice graph, I am not sure that the use case is common enough > to justify a new plotting method. One can get the same result with: > > > In [68]: x = np.linspace(0, 2 * np.pi) > > In [69]: y_sin = np.sin(x) > > In [70]: err = np.concatenate([y_sin + 0.2, y_sin[::-1] - 0.2]) > > In [71]: plot(x, y_sin) > Out[71]: [<matplotlib.lines.Line2D object at 0x96959ec>] > > In [72]: fill_between(np.concatenate([x, x[::-1]]), err, > facecolor='red', alpha=0.5) > Out[72]: <matplotlib.collections.PolyCollection object at 0x962758c> > > Admittedly the [::-1] thing is a bit counter-intuitive, but rather than > adding a new plotting method, perhaps we would be better off with a helper > method to create the xs and ys for fill_between > > xs, ys = mlab.pad_line(x, y, 0.2) > fill_between(xs, ys) > > JDH > At the very least, it should be added to the gallery. Also, one thing that might (or might not) get in the way of getting merged into mainline mpl is how well it interacts with legends. What does it produce in the legend? Ben Root |