From: matthew a. <ma...@ca...> - 2004-02-04 05:26:39
|
On Tue, 3 Feb 2004, John Hunter wrote: > So enough excuses! I agree that the current implementation is > suboptimal and will give it some more thought. Out of curiosity: do > the undersirable tick locs appear more frequently for you on an > initial plot or after interacting with the plot. I haven't been using the pan and zoom stuff very much, the issues I described this week are all from initial plots. If I had been doing more zooming then I would have noticed your very good point about jumping ticks being distracting. It's fiddly stuff, but getting it right helps a lot when interpreting results from plots! > This is a consequence of the way python and Numeric do ranges, and > doesn't really have anything to do with matplotlib. eg, the Numeric > function arange > > >>> from Numeric import * > >>> arange(0.0, 1.0, 0.2) > array([ 0. , 0.2, 0.4, 0.6, 0.8]) > > >>> range(5) > [0, 1, 2, 3, 4] > > Ie, ignore the end point is the default behavior of python. I guessed as much. But I think in this case the python behaviour needs to be over-ridden. Python range logic is generally about integers, arange stretches it, and using this [) style range for plots over-stretches the principle beyond usefulness. There are also a couple of contradictions in matplotlib's behaviour: * the axis and tick ranges are inclusive, but the data point range is exclusive of the higher end point only * the auto data range (axis()) is inclusive, but setting it manually is exclusive of the higher end point only Some of this may be alleviated by chooing better tick points. But I think it would also be helpful to make whichever behaviour is chosen more consistent. Cheers, Matthew. |