From: Perry G. <pe...@st...> - 2005-11-03 15:18:11
|
On Nov 3, 2005, at 12:55 AM, Jordan Dawe wrote: > >> Isn't this closely related to the idea we've tslked about a number of >> times (mostly off list) to supplant the colormap infrastructure with a >> "DiscreteColormap" or something along those lines, which mapped data >> to a set of discrete colors, using nearest neighbor or what have >> you. Then you would have the best of both worlds: your favorite >> colors and consistency with the mpl colorbar/colormapping API. Would >> this work? >> > I don't quite understand the idea here, but the colorbar mapping is > really only part of this. If you make classes for each plot type, you > could do things like make legend() a call to the PlotClass.Legend() > method, and each plot could make it's own kind of legend. > > I know this is a large architecture change, but it could be > implimented incrimentally and I think it would give a lot of benefits > in regards to what you could do with customizing different plot > behaviours. But, as I said before, I don't really have nearly the > grasp of the matplotlib codebase that the devs do. It doesn't look > too difficult to me, but there are probably issues I am not aware of. > Is there any reason each plot type shouldn't have it's own class? > I get the feeling that two different ideas are being discussed here. A discrete color map still would require someone to define a custom one if they have a favorite set of colors they want to use for each contour level. That involves some level of inconvenience. I gather from what Jordan is saying is that he wants to be able to automatically construct a colorbar from the colors assigned to each contour level without having to construct a colormap in the first place. That is, after the contour is done with its specific color/level assignments, then a request for a colorbar would show a linear relationship between data levels and the discrete colors chosen. Do I understand correctly? Perry |