Mixed format for y-axis in semilogy

John W. Eaton jwe at bevo.che.wisc.edu
Fri Feb 1 01:22:42 CST 2008


On 31-Jan-2008, Petr Mikulik wrote:

| > | > set format y "10^{%T}"
| > | > set termoption enhanced
| > 
| > Here's a patch you could experiment with.  I still don't think this is
| > sufficient, because it will prompt people to send bug reports asking
| > why the y axis uses the 10^X format and the x axis uses the XXE+/-YY.
| > So something a bit more sophisticated is needed.
| 
| The patch works OK, I think it is worth for committing.
| 
| The "more sophisticated" format for linear axis could be:
| 
| if ( fabs(xmax-xmin) > 1e6 ) then
|   set format x "%.0t*10^{%T}"

Using this method for linear scales, the original example of a
semilogy plot with the y range going from 10 to 10^8 and the x range
going from 0 to 2x10^{-6}, we still get tic labels of

  0, 5e-07, 1e-06, 1.5e-06, 2e-06

because the abs(xmax-xmin) is not greater than 1e6.

I don't have time at the moment to try to come up with a better
solution, so I think I have to stop working on this problem.  I'll
consider patches that work (they can certainly be based on the patch I
sent earlier), but I can't be the one to come up with the better
solution based on vague suggestions.

jwe


More information about the Bug-octave mailing list