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
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1
(2) |
2
(2) |
3
(4) |
4
(3) |
5
|
6
(3) |
7
(1) |
8
|
9
(7) |
10
(8) |
11
(14) |
12
(11) |
13
(14) |
14
(2) |
15
|
16
(4) |
17
(4) |
18
(9) |
19
(2) |
20
|
21
(2) |
22
|
23
(3) |
24
(7) |
25
(15) |
26
(2) |
27
(8) |
28
(4) |
29
(2) |
30
(5) |
31
(8) |
|
|
|
|
From: Benjamin R. <ben...@ou...> - 2010-08-11 20:11:30
|
I am tracing down a bug in hist() and I am trying to figure out what is it about the 'stepfilled' mode that is different from the regular 'bar' mode. Currently, the hist() code has a separate if branch for dealing with 'step' and 'stepfilled', and that branch has a bunch of bugs. The best that I can figure is that it prevents lines from being drawn in between the bins. If that is the only difference, maybe we could somehow use the bar functions? At the very least, I think this needs to be documented better to make it clear why this oddball approach is happening. Thanks, Ben Root |
From: John H. <jd...@gm...> - 2010-08-11 18:50:11
|
On Wed, Aug 11, 2010 at 1:32 PM, Benjamin Root <ben...@ou...> wrote: > Couldn't we just do what Google does and put a "Beta" label on everything? > > "Matplotlib Beta" > > Sounds almost like a planet or something... That used to be my attitude. Turns out there are a lot of legitimate users who cannot (due to company IT policy) or will not use software at 1.0 and below or in beta. It's a nice crutch for developers to say "hey it's in beta so don't count on us not pulling the API rug out from under you". We have historically been very cautious about breaking API, and the code is mature and stable, so the version number should reflect that in my view. JDH |
From: Friedrich R. <fri...@gm...> - 2010-08-11 18:33:14
|
Sorry, forgot source code (you cannot run it, though). Friedrich |
From: Benjamin R. <ben...@ou...> - 2010-08-11 18:32:44
|
On Wed, Aug 11, 2010 at 1:27 PM, John Hunter <jd...@gm...> wrote: > On Wed, Aug 11, 2010 at 12:35 PM, Eric Firing <ef...@ha...> wrote: > > John et al., > > > > Is this a reasonable time to put out 1.0.1? There have been quite a few > > bugfixes and other cleanups since 1.0. Most likely the biggest problem > with > > 1.0 is my error in the tk show(), which you tripped over, and which > prompted > > the thread below. > > I've been meaning to ask you the same thing :-). We probably need to > have a go at the bug tracker before 1.0.1, but I am happy to do a > bugfix release as soon as we are ready. > > Or perhaps we should be a little more aggressive on our numbering. > Ie, bugfix releases could be 1.1.0 and 1.0.1, a micro release would be > for installer fixes and the like. > > major numbers: significant new features, minor API breakage > minor numbers: significant bugfixes and near guaranteed API compat > micro: minor bugfixes, API compat > > I think 1.0 understates the maturity of the project so we may want to > get to 2.0 in less than 10 years :-) > > JDH > > Couldn't we just do what Google does and put a "Beta" label on everything? "Matplotlib Beta" Sounds almost like a planet or something... Ben Root |
From: Friedrich R. <fri...@gm...> - 2010-08-11 18:31:38
|
http://www.youtube.com/watch?v=aa5eWT-J3v0 |
From: John H. <jd...@gm...> - 2010-08-11 18:28:02
|
On Wed, Aug 11, 2010 at 12:35 PM, Eric Firing <ef...@ha...> wrote: > John et al., > > Is this a reasonable time to put out 1.0.1? There have been quite a few > bugfixes and other cleanups since 1.0. Most likely the biggest problem with > 1.0 is my error in the tk show(), which you tripped over, and which prompted > the thread below. I've been meaning to ask you the same thing :-). We probably need to have a go at the bug tracker before 1.0.1, but I am happy to do a bugfix release as soon as we are ready. Or perhaps we should be a little more aggressive on our numbering. Ie, bugfix releases could be 1.1.0 and 1.0.1, a micro release would be for installer fixes and the like. major numbers: significant new features, minor API breakage minor numbers: significant bugfixes and near guaranteed API compat micro: minor bugfixes, API compat I think 1.0 understates the maturity of the project so we may want to get to 2.0 in less than 10 years :-) JDH |
From: Ryan K. <rya...@gm...> - 2010-08-11 18:18:37
|
FWIW, I responded to a thread on the IPython list where someone else was asking why show() was blocking execution on Windows 7. I think he was really experiencing the tk show() problem from mpl. So, I think this is causing issues with other users (in my opinion). Ryan On Wed, Aug 11, 2010 at 12:35 PM, Eric Firing <ef...@ha...> wrote: > John et al., > > Is this a reasonable time to put out 1.0.1? There have been quite a few > bugfixes and other cleanups since 1.0. Most likely the biggest problem > with 1.0 is my error in the tk show(), which you tripped over, and which > prompted the thread below. > > Eric > > -------- Original Message -------- > Subject: Re: [Matplotlib-users] show() blocks script execution for > TkAgg from ipython -pylab > Date: Wed, 11 Aug 2010 09:35:24 -0700 > From: Christoph Gohlke <cg...@uc...> > To: mat...@li... > > Ryan: you could try matplotlib-1.0.0.svn.win32-py2.6.exe from > http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib .It was built this > morning from svn. > > Christoph > > On 8/11/2010 7:26 AM, Ryan Krauss wrote: >> 0.99.3 is more or less fine, but there is an annoying exception window >> that pops up if you close IPython with a plot window open (using the >> TkAgg backend). But in my mind this is less bothersome than having to >> close all the plot windows every time I run a script (I tend to write >> scripts that generate 5-10 plots at a minimum). >> >> If I could easily build an installer from svn, I would try it. I >> don't have any microsoft compilers installed on my windows computers. >> >> Thanks again, >> >> Ryan >> >> On Wed, Aug 11, 2010 at 9:09 AM, Ryan Krauss<rya...@gm...> wrote: >>> Thanks. >>> >>> I need to role out a python install for my students. Classes start in >>> a week and a half. What should I do? The installation for most of >>> them needs to be fairly simple. >>> >>> Thanks, >>> >>> Ryan >>> >>> On Wed, Aug 11, 2010 at 2:25 AM, Eric Firing<ef...@ha...> wrote: >>>> On 08/10/2010 05:43 PM, Ryan Krauss wrote: >>>>> I just upgraded my windows machine to matplotlib 1.0.0 and a simple >>>>> script such as >>>>> >>>>> from pylab import * >>>>> from scipy import * >>>>> >>>>> t = arange(0,1,0.01) >>>>> y = sin(2*pi*t) >>>>> >>>>> figure(1) >>>>> clf() >>>>> plot(t,y) >>>>> >>>>> show() >>>>> >>>>> Now halts execution when run from the ipython -pylab prompt. The same >>>>> commands typed at the commandline do not lead to show() halting >>>>> execution. >>>>> >>>>> Is this expected behavior? >>>> >>>> This was fixed three weeks ago in svn, both the maintenance branch and >>>> the trunk. I made some changes in show() shortly before 1.0, trying to >>>> get uniform and reasonable behavior in all backends, and I didn't quite >>>> succeed. I think I got it all straightened out--but only after the >>>> release, unfortunately. I hope it won't be too long before a 1.0.1 >>>> bugfix release can be made, but I am aware of no schedule. >>>> >>>> Eric >>>> >>>>> >>>>> Thanks, >>>>> >>>>> Ryan >>>>> > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > |
From: Eric F. <ef...@ha...> - 2010-08-11 17:35:31
|
John et al., Is this a reasonable time to put out 1.0.1? There have been quite a few bugfixes and other cleanups since 1.0. Most likely the biggest problem with 1.0 is my error in the tk show(), which you tripped over, and which prompted the thread below. Eric -------- Original Message -------- Subject: Re: [Matplotlib-users] show() blocks script execution for TkAgg from ipython -pylab Date: Wed, 11 Aug 2010 09:35:24 -0700 From: Christoph Gohlke <cg...@uc...> To: mat...@li... Ryan: you could try matplotlib-1.0.0.svn.win32-py2.6.exe from http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib .It was built this morning from svn. Christoph On 8/11/2010 7:26 AM, Ryan Krauss wrote: > 0.99.3 is more or less fine, but there is an annoying exception window > that pops up if you close IPython with a plot window open (using the > TkAgg backend). But in my mind this is less bothersome than having to > close all the plot windows every time I run a script (I tend to write > scripts that generate 5-10 plots at a minimum). > > If I could easily build an installer from svn, I would try it. I > don't have any microsoft compilers installed on my windows computers. > > Thanks again, > > Ryan > > On Wed, Aug 11, 2010 at 9:09 AM, Ryan Krauss<rya...@gm...> wrote: >> Thanks. >> >> I need to role out a python install for my students. Classes start in >> a week and a half. What should I do? The installation for most of >> them needs to be fairly simple. >> >> Thanks, >> >> Ryan >> >> On Wed, Aug 11, 2010 at 2:25 AM, Eric Firing<ef...@ha...> wrote: >>> On 08/10/2010 05:43 PM, Ryan Krauss wrote: >>>> I just upgraded my windows machine to matplotlib 1.0.0 and a simple >>>> script such as >>>> >>>> from pylab import * >>>> from scipy import * >>>> >>>> t = arange(0,1,0.01) >>>> y = sin(2*pi*t) >>>> >>>> figure(1) >>>> clf() >>>> plot(t,y) >>>> >>>> show() >>>> >>>> Now halts execution when run from the ipython -pylab prompt. The same >>>> commands typed at the commandline do not lead to show() halting >>>> execution. >>>> >>>> Is this expected behavior? >>> >>> This was fixed three weeks ago in svn, both the maintenance branch and >>> the trunk. I made some changes in show() shortly before 1.0, trying to >>> get uniform and reasonable behavior in all backends, and I didn't quite >>> succeed. I think I got it all straightened out--but only after the >>> release, unfortunately. I hope it won't be too long before a 1.0.1 >>> bugfix release can be made, but I am aware of no schedule. >>> >>> Eric >>> >>>> >>>> Thanks, >>>> >>>> Ryan >>>> |
From: Benjamin R. <ben...@ou...> - 2010-08-11 17:29:05
|
On Wed, Aug 11, 2010 at 11:47 AM, Friedrich Romstedt < fri...@gm...> wrote: > 2010/8/11 Eric Firing <ef...@ha...>: > > Why make a whole new class instead of switching a behavior in an existing > > class? > > To my understanding, making object having "behaviours" is usually not > a good idea - I like different classes much more. I believe this is > just a matter of taste, both solutions will work. > > But when you think about Ben's last problem with global effects, this > would not happen when using a different colormap instance. > > Btw, I think it's undesired to mix colour and b/w in a figure. What > is the use-case? Making one figure in one paper at a time. As soon > as color is in, everything can be color. Maybe we should decide here > clearly by the best design proposal, and leave the use-case question > alone. > > My thinking here is that I really don't want to place unnecessary restrictions upon how a user uses a feature. Things should be a modular as possible (which is why I was looking more for a convenience function than anything else). Why should we have to declare that a user will never need a B&W and color figure? Maybe a user wants to produce both B&W and color versions simultaneously? In my case in particular, it takes about 15 minutes to generate one of my publication-quality images, but only a couple of minutes to save it. It would be beneficial to me to save both b&w and color versions. Another possible use-case would be someone who wants to take a figure that might usually be colored but make a version of it in B&W with color annotations for highlighting purposes. The point is that I would like to give the users fine-grained control over what they need, especially when the barrier to provide such control is virtually non-existent. > My thinking about moving it to the renderers is driven by the question > where the functionality belongs to. When we want to product b/w > plots, this has initially nothing to do with colormaps. It also > applies to lines, scatterplots, images, whatever one can imagine. So > I thought it may be a good idea to apply b/w to the rendered objects > in the end, i.e. LineCollections, QuadMeshs, and so on. > > That would be a nice feature, too. And it would also apply globally across all elements within the figure. I would not object to also having this feature in addition to the ability to control my colormaps. > >> Another option would be, to wrap the Colormap into a thin layer with > >> __call__, but this appears way too clumsy and too hacky to me. It's a > >> clumsy way of deriving from the class. Otherwise it's maybe also > >> nice, because it's generic, for all Colormaps. __getattr__ and > >> __setattr__ (iirc) could be used to simulate the wrapped instance > >> fully. > > > > I don't follow you on this--I don't understand at all. > > Well, personally I have abandoned this possibility, but just for > completeness: > > class GrayWrapper: > def __init__(self, wrapped_colormap): > self._wrapped_colormap = wrapped_colormap > > def __call__(self, value): > wrapped_colour = self._wrapped_colormap(value) > ... > return turned_into_gray > > Interesting, but I still wonder if it is just better to have a function that returns a grey version of the colormap. Although, one could extend this idea (albeit probably not necessary) to include a variety of different colormap transformations (brighten, darken, invert, etc.). > > I don't understand why you would want to push this down into the > renderers > > instead of keeping it at a higher level. And I don't know what you mean > by > > "getting rid of the alpha stuff". > > See above. Here is an example for QuadMesh, it breaks down via > QuadMesh.set_facecolors(), > matplotlib.colors.colorConvert.to_rgba_array(), > ColorConverter.to_rgba(), ColorConverter.to_rgb() (note the missing > 'a'), and there it's in principle: > > >>> color = tuple(arg[:3]) > or some other conversion to a 3-tuple > >>> return color > and just before we could do the rgb->pseudogray conversion > . So in my opinion this is the perfect place to do the color > conversion. I suppose all the other color conversions also break down > to ColorConverter. > > But, the alpha information is important. The renderers need it. I am not seeing the rational for completely stripping it out. I can see a rational for being able to modify the alpha, but not for stripping it out. > > Yes, there does seem to be a need for these sorts of switching > operations. > > Getting back to the colormap question, our discussions have been based > on > > the assumption that an rgb_to_gray function is all that is needed. But > is > > this true? Or will users actually need completely different graymaps > rather > > than something resembling a black-and-white photo of a colormap? If so, > > then my suggested strategy is useless. > > No it's not it's just complementary. What we want do here is the b/w > photography. > > Do we want to allow for users to specify their own LUMA conversion coefficients? > I'll just hack my matplotlib now to do the LUMA XXX conversion now > always, and will see what it does ... > > Friedrich > > Regards, Ben Root |
From: Friedrich R. <fri...@gm...> - 2010-08-11 16:47:12
|
2010/8/11 Eric Firing <ef...@ha...>: > Why make a whole new class instead of switching a behavior in an existing > class? To my understanding, making object having "behaviours" is usually not a good idea - I like different classes much more. I believe this is just a matter of taste, both solutions will work. But when you think about Ben's last problem with global effects, this would not happen when using a different colormap instance. Btw, I think it's undesired to mix colour and b/w in a figure. What is the use-case? Making one figure in one paper at a time. As soon as color is in, everything can be color. Maybe we should decide here clearly by the best design proposal, and leave the use-case question alone. My thinking about moving it to the renderers is driven by the question where the functionality belongs to. When we want to product b/w plots, this has initially nothing to do with colormaps. It also applies to lines, scatterplots, images, whatever one can imagine. So I thought it may be a good idea to apply b/w to the rendered objects in the end, i.e. LineCollections, QuadMeshs, and so on. >> Another option would be, to wrap the Colormap into a thin layer with >> __call__, but this appears way too clumsy and too hacky to me. It's a >> clumsy way of deriving from the class. Otherwise it's maybe also >> nice, because it's generic, for all Colormaps. __getattr__ and >> __setattr__ (iirc) could be used to simulate the wrapped instance >> fully. > > I don't follow you on this--I don't understand at all. Well, personally I have abandoned this possibility, but just for completeness: class GrayWrapper: def __init__(self, wrapped_colormap): self._wrapped_colormap = wrapped_colormap def __call__(self, value): wrapped_colour = self._wrapped_colormap(value) ... return turned_into_gray > I don't understand why you would want to push this down into the renderers > instead of keeping it at a higher level. And I don't know what you mean by > "getting rid of the alpha stuff". See above. Here is an example for QuadMesh, it breaks down via QuadMesh.set_facecolors(), matplotlib.colors.colorConvert.to_rgba_array(), ColorConverter.to_rgba(), ColorConverter.to_rgb() (note the missing 'a'), and there it's in principle: >>> color = tuple(arg[:3]) or some other conversion to a 3-tuple >>> return color and just before we could do the rgb->pseudogray conversion . So in my opinion this is the perfect place to do the color conversion. I suppose all the other color conversions also break down to ColorConverter. > Yes, there does seem to be a need for these sorts of switching operations. > Getting back to the colormap question, our discussions have been based on > the assumption that an rgb_to_gray function is all that is needed. But is > this true? Or will users actually need completely different graymaps rather > than something resembling a black-and-white photo of a colormap? If so, > then my suggested strategy is useless. No it's not it's just complementary. What we want do here is the b/w photography. I'll just hack my matplotlib now to do the LUMA XXX conversion now always, and will see what it does ... Friedrich |
From: Benjamin R. <ben...@ou...> - 2010-08-11 03:22:53
|
On Tue, Aug 10, 2010 at 7:39 PM, Benjamin Root <ben...@ou...> wrote: > On Tue, Aug 10, 2010 at 7:20 PM, Eric Firing <ef...@ha...> wrote: > >> On 08/10/2010 11:58 AM, Friedrich Romstedt wrote: >> > 2010/8/10 Eric Firing<ef...@ha...>: >> >> On 08/10/2010 10:27 AM, Friedrich Romstedt wrote: >> >>> So I think it is probably best to code it into the Colormap object >> >>> itself, so that each and ever derived class can define its own method >> >>> of how to create a greyscale version. What do you think about that? >> >> >> >> Good idea. The base class could define a default to_grayscale() method >> >> that would do the conversion near the very end of the Colormap.__call__ >> >> method if an as_gray attribute, also defined in the base class, is >> True. >> >> No need for getters and setters--let it be a simple attribute. This >> >> is much simpler than generating a whole new colormap--instead, just set >> >> an attribute to switch an existing colormap to gray or back to color. >> I >> >> would leave the switch out of the __init__ args and kwargs. >> > >> >> If someone >> >> wants grey, they can add one more line of code to set the attribute. >> > >> > Hmm, one would have to do it for every colormap used. Also, it would >> > be not so obvious if using the default colormap. >> > >> >> I >> >> suspect only a small fraction of users will need this. >> > >> > I like this, it's a good idea enabling to not repeat all the stuff in >> > the code. But hey, wouldn't it be the same to just overload the >> > __call__ method? >> > >> > class GrayColorbar(RgbColorbar): >> > """A colorbar returning grayscaled version.""" >> > >> > def __call__(self, value): >> > """Transforms RgbColorbar's value into grayscale, and returns >> it."""" >> > >> > rgb = BaseClass.__call__(self, value) >> > [do stuff] >> > return grayscale >> >> Why make a whole new class instead of switching a behavior in an >> existing class? >> >> > >> > Agreed, one has to this for all the classes, while your solution works >> > generically in ColormapBase or whatever it's called. >> >> I think my solution (with slight modification) is also very compatible >> with your suggestion below to have an rc param that switches between >> color and gray. If as_gray is None, use the rc value; otherwise, let it >> act as described above. >> >> The typical use case is when one wants color initially, but then must >> regenerate plots in black and white to reduce publication costs. Your >> rc suggestion facilitates such switching. >> >> > >> > Another option would be, to wrap the Colormap into a thin layer with >> > __call__, but this appears way too clumsy and too hacky to me. It's a >> > clumsy way of deriving from the class. Otherwise it's maybe also >> > nice, because it's generic, for all Colormaps. __getattr__ and >> > __setattr__ (iirc) could be used to simulate the wrapped instance >> > fully. >> >> I don't follow you on this--I don't understand at all. >> >> >> > >> > Is there some layer dealing with colors in the renderers, where the >> > conversion could also happen? I'm asking because of displaying color >> > images etc. and printing them as grayscale. With this, we would get >> > rid of the alpha stuff completely, too. >> >> I don't understand why you would want to push this down into the >> renderers instead of keeping it at a higher level. And I don't know >> what you mean by "getting rid of the alpha stuff". >> >> > >> > Maybe a general matplotlib.rc switch 'greyscale' would be possible. >> > It would leave room for tons of improvement, e.g. automatically >> > setting the color cycle to - -- -. etc., there was some monthes ago >> > discussion about how to achieve that. Another advantage: It's zero >> > loc if set in the config file ;-) >> >> Yes, there does seem to be a need for these sorts of switching >> operations. Getting back to the colormap question, our discussions have >> been based on the assumption that an rgb_to_gray function is all that is >> needed. But is this true? Or will users actually need completely >> different graymaps rather than something resembling a black-and-white >> photo of a colormap? If so, then my suggested strategy is useless. >> >> Eric >> >> > >> > I think that would be a real neat new feature. >> > >> > I agree what's not needed is mixed greyscale and colour display in the >> > same Figure. >> > >> > Bear with me if my ideas are always too radical. >> > >> > Friedrich >> >> > I have to agree with Eric on this. Maybe I am just not understanding > Friedrich's thought process. > > If someone wants a specific greyscale colormapping, then they can make it > themselves just like any other colormap. However, it is as a matter of > convenience and ease to say "hey, I have this colormap that I have been > using in my code, but I need its greyscale equivalent". > > My idea is this. It appears that all colormappings get a lookup table > (self._lut) that contains rgba values. We could also simultaneously > maintain a second lookup table (initialized only when needed). Therefore, > one could take a colormap, switch on the greyscale attribute when desired > (which would swap the two tables), and switch back over to the color-scale > with the same amount of ease. > > It would be independent of any Colormap subclass because it would be in the > base class. My only concern is when do the various drawing elements > actually use the colormap info? If I create a b&w figure in one subplot, > but also a colored figure in another subplot (for whatever reason) using the > same colormap, would the figure show as expected at render-time? > > Thoughts, concerns, comments? > > Ben Root > Ok, I have made some code that let's me easily switch between modes and works quite nicely. However, something I suspected would happen occurs. If I were to use the colormap and ever change the mode before rendering, *all* places where that colormap was used is colored according to the mode last set before rendering. This could be considered a bug or a feature, depending on one's viewpoint. I suspect if one really needed independent colormaps, one could use deepcopy before applying the alternate colormap to the axes. I am including a patch to this email for a looking over (be brutal). Note, it is hardly ready for inclusion as I am sure there are some other behaviors I haven't thought of. Below is a quick example of how to use the new feature. Enjoy! Ben Root import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm X, Y = np.mgrid[-10:10, -10:10] Z = np.abs(X * Y) cmap = cm.get_cmap() cmap.grey_mode = True plt.pcolor(X, Y, Z, cmap=cmap) plt.show() |
From: Benjamin R. <ben...@ou...> - 2010-08-11 00:40:04
|
On Tue, Aug 10, 2010 at 7:20 PM, Eric Firing <ef...@ha...> wrote: > On 08/10/2010 11:58 AM, Friedrich Romstedt wrote: > > 2010/8/10 Eric Firing<ef...@ha...>: > >> On 08/10/2010 10:27 AM, Friedrich Romstedt wrote: > >>> So I think it is probably best to code it into the Colormap object > >>> itself, so that each and ever derived class can define its own method > >>> of how to create a greyscale version. What do you think about that? > >> > >> Good idea. The base class could define a default to_grayscale() method > >> that would do the conversion near the very end of the Colormap.__call__ > >> method if an as_gray attribute, also defined in the base class, is True. > >> No need for getters and setters--let it be a simple attribute. This > >> is much simpler than generating a whole new colormap--instead, just set > >> an attribute to switch an existing colormap to gray or back to color. I > >> would leave the switch out of the __init__ args and kwargs. > > > >> If someone > >> wants grey, they can add one more line of code to set the attribute. > > > > Hmm, one would have to do it for every colormap used. Also, it would > > be not so obvious if using the default colormap. > > > >> I > >> suspect only a small fraction of users will need this. > > > > I like this, it's a good idea enabling to not repeat all the stuff in > > the code. But hey, wouldn't it be the same to just overload the > > __call__ method? > > > > class GrayColorbar(RgbColorbar): > > """A colorbar returning grayscaled version.""" > > > > def __call__(self, value): > > """Transforms RgbColorbar's value into grayscale, and returns > it."""" > > > > rgb = BaseClass.__call__(self, value) > > [do stuff] > > return grayscale > > Why make a whole new class instead of switching a behavior in an > existing class? > > > > > Agreed, one has to this for all the classes, while your solution works > > generically in ColormapBase or whatever it's called. > > I think my solution (with slight modification) is also very compatible > with your suggestion below to have an rc param that switches between > color and gray. If as_gray is None, use the rc value; otherwise, let it > act as described above. > > The typical use case is when one wants color initially, but then must > regenerate plots in black and white to reduce publication costs. Your > rc suggestion facilitates such switching. > > > > > Another option would be, to wrap the Colormap into a thin layer with > > __call__, but this appears way too clumsy and too hacky to me. It's a > > clumsy way of deriving from the class. Otherwise it's maybe also > > nice, because it's generic, for all Colormaps. __getattr__ and > > __setattr__ (iirc) could be used to simulate the wrapped instance > > fully. > > I don't follow you on this--I don't understand at all. > > > > > > Is there some layer dealing with colors in the renderers, where the > > conversion could also happen? I'm asking because of displaying color > > images etc. and printing them as grayscale. With this, we would get > > rid of the alpha stuff completely, too. > > I don't understand why you would want to push this down into the > renderers instead of keeping it at a higher level. And I don't know > what you mean by "getting rid of the alpha stuff". > > > > > Maybe a general matplotlib.rc switch 'greyscale' would be possible. > > It would leave room for tons of improvement, e.g. automatically > > setting the color cycle to - -- -. etc., there was some monthes ago > > discussion about how to achieve that. Another advantage: It's zero > > loc if set in the config file ;-) > > Yes, there does seem to be a need for these sorts of switching > operations. Getting back to the colormap question, our discussions have > been based on the assumption that an rgb_to_gray function is all that is > needed. But is this true? Or will users actually need completely > different graymaps rather than something resembling a black-and-white > photo of a colormap? If so, then my suggested strategy is useless. > > Eric > > > > > I think that would be a real neat new feature. > > > > I agree what's not needed is mixed greyscale and colour display in the > > same Figure. > > > > Bear with me if my ideas are always too radical. > > > > Friedrich > > I have to agree with Eric on this. Maybe I am just not understanding Friedrich's thought process. If someone wants a specific greyscale colormapping, then they can make it themselves just like any other colormap. However, it is as a matter of convenience and ease to say "hey, I have this colormap that I have been using in my code, but I need its greyscale equivalent". My idea is this. It appears that all colormappings get a lookup table (self._lut) that contains rgba values. We could also simultaneously maintain a second lookup table (initialized only when needed). Therefore, one could take a colormap, switch on the greyscale attribute when desired (which would swap the two tables), and switch back over to the color-scale with the same amount of ease. It would be independent of any Colormap subclass because it would be in the base class. My only concern is when do the various drawing elements actually use the colormap info? If I create a b&w figure in one subplot, but also a colored figure in another subplot (for whatever reason) using the same colormap, would the figure show as expected at render-time? Thoughts, concerns, comments? Ben Root |
From: Eric F. <ef...@ha...> - 2010-08-11 00:20:47
|
On 08/10/2010 11:58 AM, Friedrich Romstedt wrote: > 2010/8/10 Eric Firing<ef...@ha...>: >> On 08/10/2010 10:27 AM, Friedrich Romstedt wrote: >>> So I think it is probably best to code it into the Colormap object >>> itself, so that each and ever derived class can define its own method >>> of how to create a greyscale version. What do you think about that? >> >> Good idea. The base class could define a default to_grayscale() method >> that would do the conversion near the very end of the Colormap.__call__ >> method if an as_gray attribute, also defined in the base class, is True. >> No need for getters and setters--let it be a simple attribute. This >> is much simpler than generating a whole new colormap--instead, just set >> an attribute to switch an existing colormap to gray or back to color. I >> would leave the switch out of the __init__ args and kwargs. > >> If someone >> wants grey, they can add one more line of code to set the attribute. > > Hmm, one would have to do it for every colormap used. Also, it would > be not so obvious if using the default colormap. > >> I >> suspect only a small fraction of users will need this. > > I like this, it's a good idea enabling to not repeat all the stuff in > the code. But hey, wouldn't it be the same to just overload the > __call__ method? > > class GrayColorbar(RgbColorbar): > """A colorbar returning grayscaled version.""" > > def __call__(self, value): > """Transforms RgbColorbar's value into grayscale, and returns it."""" > > rgb = BaseClass.__call__(self, value) > [do stuff] > return grayscale Why make a whole new class instead of switching a behavior in an existing class? > > Agreed, one has to this for all the classes, while your solution works > generically in ColormapBase or whatever it's called. I think my solution (with slight modification) is also very compatible with your suggestion below to have an rc param that switches between color and gray. If as_gray is None, use the rc value; otherwise, let it act as described above. The typical use case is when one wants color initially, but then must regenerate plots in black and white to reduce publication costs. Your rc suggestion facilitates such switching. > > Another option would be, to wrap the Colormap into a thin layer with > __call__, but this appears way too clumsy and too hacky to me. It's a > clumsy way of deriving from the class. Otherwise it's maybe also > nice, because it's generic, for all Colormaps. __getattr__ and > __setattr__ (iirc) could be used to simulate the wrapped instance > fully. I don't follow you on this--I don't understand at all. > > Is there some layer dealing with colors in the renderers, where the > conversion could also happen? I'm asking because of displaying color > images etc. and printing them as grayscale. With this, we would get > rid of the alpha stuff completely, too. I don't understand why you would want to push this down into the renderers instead of keeping it at a higher level. And I don't know what you mean by "getting rid of the alpha stuff". > > Maybe a general matplotlib.rc switch 'greyscale' would be possible. > It would leave room for tons of improvement, e.g. automatically > setting the color cycle to - -- -. etc., there was some monthes ago > discussion about how to achieve that. Another advantage: It's zero > loc if set in the config file ;-) Yes, there does seem to be a need for these sorts of switching operations. Getting back to the colormap question, our discussions have been based on the assumption that an rgb_to_gray function is all that is needed. But is this true? Or will users actually need completely different graymaps rather than something resembling a black-and-white photo of a colormap? If so, then my suggested strategy is useless. Eric > > I think that would be a real neat new feature. > > I agree what's not needed is mixed greyscale and colour display in the > same Figure. > > Bear with me if my ideas are always too radical. > > Friedrich |