From: Darren D. <dd...@co...> - 2004-09-08 20:15:31
|
Matt Newville wrote: >Darren Dale wrote: > > > >>I strongly support stripping all unnecessary zeros from the labels. It >>seems a clear choice to me, but I would be interested to know if others >>are against it. >> >> > >I agree that stripping unnecessary zeros from labels is a good >idea, but I also prefer preserving significant trailing zeros, and >do not like axes reading (for example): > 0.997 0.998 0.999 1 1.001 1.002 > >In my opinion, that '1' should be '1.000': the precision here is >significant. I also prefer more uniform series of '0.0 0.5 1.0' >to the jagged appearance of '0 0.5 1'. Maybe that's just my >interpretation of 'necessary'. > >Currently, ScalarFormatter prefers '1' to '1.000'. I also see >that it uses the axis "span" to determine the formatting. I'm not >sure how easy it would be to change, but it might be better to use >the difference between axis ticks so that the formatting >guaranteed unique labels with "just enough precision". > > I have been mulling this over myself. Each label is formatted independently of the rest, so guessing the precision to display would be difficult. It would be easier if all labels were formatted together with one call to scalarFormatter, but I dont think that is a possibility. Alternatively, it would be possible to write custom formatter that accepted an integer to display the proper precision. Matlab will truncate precision at 4 places past the decimal point. At that point the labels are already looking a bit long. Matlab also represents 1.0000 as 1, regardless of the other labels. I am planning a scalarFormatterMathtext, which will replace 1e6 with the more desirable $1*10^6$, and will consider precision. Darren |