Menu

#1701 Default logscale mtics are weird

None
closed
nobody
None
2016-09-03
2015-11-04
dima
No

Hi. This isn't strictly a "bug" report, but there's some surprising default behavior in gnuplot. Example:

set logscale y
plot [][1:1e5] x**2

Look at the mtics on the y axis. In each decade the minor tics are at positions 2,5,8. This is surprising because it's not evenly spaced. Including the major tics, the positions are 1,2,5,8,10 for intervals of length 1,3,3,2. mtics are unlabeled, so their positions should be as unsurprising as possible, and thus I think this is wrong. How about instead of 2,5,8 we do 4,7, or maybe 3.25,5.5,7.75? The logic lives here: https://github.com/gnuplot/gnuplot/blob/master/src/axis.c#L1174 The current settings of ministart=2, ministep=3 would need to be changed

Discussion

  • Ethan Merritt

    Ethan Merritt - 2015-11-05

    From "help logscale"

    Note that the ticmarks generated for logscaled axes are not uniformly
    spaced. See `set xtics`.
    

    From "help set mxtics"

     If the axis is logarithmic, the number of sub-intervals will be set to a
     reasonable number by default (based upon the length of a decade).  This
     will be overridden if <freq> is given.  However the usual minor tics
     (2, 3, ..., 8, 9 between 1 and 10, for example) are obtained by setting
     <freq> to 10, even though there are but nine sub-intervals.
    

    I have my doubts that anyone would find the sequence [1 3.25 5.5 7.75 10] less surprising than any set of integer values.

     

    Last edit: Ethan Merritt 2015-11-05
  • dima

    dima - 2015-11-05

    Hi Ethan. I agree that 3.25,5.5,7.75 isn't "nice", but it doesn't mean that the current behavior is reasonable either. As it stands, we have unlabelled tic marks with extremely unintuitive positions. Thus at best they don't help the viewer of the plot, and at worst they are misleading. In my view, no tic marks are better than what we have. I think 4,7 is better than 3.25,5.5,7.75, but it still feels weird and it's the only even spacing with integer tics. How about we simply omit the sparse-mtic case? Here's what I mean. The code currently is:

    if     (we're showing >=10 decades) { no mtics }
    else if(we're showing >=5  decades) { show 2,5,8 tics}
    else                                { show 2,3,4,5,6,7,8,9 tics }
    

    What if we change it to

    if     (we're showing >=10 decades) { no mtics }
    else                                { show 2,3,4,5,6,7,8,9 tics }
    

    If that makes a too-busy plot for Ndecades between 5 and 10, we can move the threshold down a bit. But this way the viewer of the plot is never mislead and confused.

     
  • Ethan Merritt

    Ethan Merritt - 2016-08-04

    Default generation of minitics has now changed.
    Now it always generates the full complement of tics (log base - 1).
    Set mXtics has also changed to work more reliably so if you really want some other spacing it possible. Maybe. I'm not convinced that they end up in reasonable places.

     
  • Ethan Merritt

    Ethan Merritt - 2016-09-03
    • status: open --> closed
    • Group: -->
    • Priority: -->
     
  • Ethan Merritt

    Ethan Merritt - 2016-09-03

    Closing this one because
    fixed for 5.1
    the fix applies to the new nonlinear axis implementation of logscale so it's not going into 5.0

     

Log in to post a comment.