|
From: Mark B. <ma...@gm...> - 2007-01-03 22:12:21
|
Thanks for writing the convenience function John ! I think there is a large group (like the students in my class) who use matplotlib as a simple tool to make beautiful graphs. To compete with matlab we need to keep simple tasks simple. I personally think that this convenience function is a good one to add. Probably under pylab. Anybody else want to weigh in? Mark On 1/3/07, John Hunter <jdh...@ac...> wrote: > > >>>>> "Mark" == Mark Bakker <ma...@gm...> writes: > > Mark> Thanks John. This works great. I think, however, that > Mark> set_backgroundcolor would be useful. It should be easy to > Mark> fix. If nobody speaks up, I will take a crack at it, Mark > > What do you have in mind, a simple convenience function that does > > def set_backgroundcolor(self, color): > """ > Set the background color of the text by updating the bbox > facecolor > > ACCEPTS: any matplotlib color > """ > if self._bbox is None: > self._bbox = dict(facecolor=color, edgecolor=color) > else: > self._bbox.update(dict(facecolor=color)) > > I'm not too opposed to it, but it does violate the maxim "There should be > one-- > and preferably only one --obvious way to do it." Of course, we > violate this throughout mpl offerings lots of convenience functions, > but it is something to bear in mind. > |