From: Darren D. <dd...@co...> - 2005-02-25 13:45:47
|
Having some email problems, my original reply wasnt sent. Hopefully this one will be... On Thursday 24 February 2005 11:02 pm, John Hunter wrote: > >>>>> "Hans" == Hans Fangohr <H.F...@so...> writes: > > Hans> x=pylab.arange(0,1e-8,1e-9)+1.0 pylab.plot(x) pylab.show() > > Hans> All works fine when I subtract the mean of x but there seems > Hans> to be a problem with labelling axes for plotted data which > Hans> is not close to zero but shows only small variations. > > I agree it's a bug. It's not immediately clear to me what the labels > should be though > > 1.0000000002 > 1.0000000004 > 1.0000000006 > > and so on? That takes up a lot of room. Granted, correct but ugly > is better than incorrect but pretty, but I'm curious if there is a > better way to format these cases. Perhaps ideal would be an indicator > at the bottom or top of the y axis that read '1+' and then use 2e-9, > 4e-9, etc as the actual tick labels. Do you agree this is ideal? Matlab will not do an offset of this type, it goes to 4 decimal places and gives up. I have been meaning to do some work with the scalarFormatter for a while now. I think we can accomplish the above using the numerix mean,std,and maybe allclose functions. I will work on it this weekend, but will need some guidance to add a new bbox to add the result to the plot. At the same time, I'll work on an option to move the scientific notation to the same place, so 1e10,2e10 will be come 1,2, with a x10^10 at the top of the axis. It was also suggested to keep the significant decimal points in the labels. I agree with that 0,0.5,1.0,1.5 looks better than 0,0.5,1,1.5. If there are any suggestions or comments, please let me know. -- Darren |