From: John H. <jdh...@ac...> - 2006-03-30 14:57:03
|
>>>>> "Eric" == Eric Firing <ef...@ha...> writes: Eric> John, At >4600 lines, axes.py is getting unwieldy, as is the Eric> Axes class that makes up the bulk of it. I propose to Eric> reorganize it and split it into at least two files. Eric> The main organizational change would separate the Eric> functionality that is directly involved in manipulating the Eric> axes from the more specific plotting methods. This could be Eric> done, for example, by putting the former in an AxesBase Eric> class, and then letting Axes inherit that. At the very Eric> least it would be nice to rearrange the methods so that all Eric> the pure Axes manipulation methods are together at the Eric> beginning. Eric> What do you think? I don't want overarching ambitions to get in the way of a simple refactor, but.... I've discussed this with Fernando and Perry on a couple of occasions, and I think it would be useful to create high level Artists like LinePlot, ScatterPlot, BarChart, etc, that carried the lines, etc, etc around with them with useful configuration methods. The pylab.plot would be a thin wrapper to Axes.plot which would instantiate a LinePlot. A bit like what you recently did for the contour function. High level plot objects like this would allow us to easily support things like a FunctionPlot, which always returns the sin(x) at any given scale, with some configurable, intelligent way to determine the granularity of sampling at a given scale. So that is background on the general topic of refactoring axes.py. As for your specific suggestion, I have no problem with it. I have never had a problem with one large file since emacs and judicious use of search-forward and search-backward work fine for me. But I know that code better than most, and I think your proposed changes would make it much easier for people approaching the code for the first time to understand what is going on. It might also make it clearer how to pursue the grand refactor down the road. But I mention it now so you can think about it while you are working :-) JDH |