Menu

#2856 logscale - Too many axis ticks requested

None
pending-fixed
nobody
None
2026-02-20
2026-02-07
No

Commands:

set xrange [ 1e6 : 1e8 ]
set logscale x
set xtics 10
plot x

results in no tics on x-axis, and gnuplot writes:
"warning: Too many axis ticks requested (>1e+07)"

Change first line to

set xrange [ 1e6 : 1e9 ]

or eliminate the third line (set xtics 10), and the error is gone.
(gnuplot v6.0.4, win11 64-bit 25H2)

Similar bug report: https://sourceforge.net/p/gnuplot/bugs/1971/

Discussion

  • Peter Gasparovic

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -10,7 +10,7 @@
    
     Change first line to
     ~~~
    -set xrange [ 1e6 : 1e8 ]
    +set xrange [ 1e6 : 1e9 ]
     ~~~
     or eliminate the third line (set xtics 10), and the error is gone.
     (gnuplot v6.0.4, win11 64-bit 25H2)
    
    • Group: -->
    • Priority: -->
     
  • Ethan Merritt

    Ethan Merritt - 2026-02-13

    But the error message is correct, right? What tick placement are you trying to obtain?

     
    • Peter Gasparovic

      I disagree. There should be no error message. On x-axis with logarithmic scaling and "set xtics 10" I expect major tic on every decimal-multiple value, and 8 minor tics between major tics (for 2-, 3-, 4-, 5-, 6-, 7-, 8-, 9-multiple). The range 1e6-1e9 contains 28 tics. The range 1e6-1e8 should contain 19 tics, and that is far from "1e+07" tics, therefore the message is nonsense.

       
  • Ethan Merritt

    Ethan Merritt - 2026-02-13

    The syntax is set xtics <start>,<increment>{,<end>}. For log scale axes the increment is multiplicative rather than additive.
    So to place major tics as you describe, the command would be
    set xtics 1.e6, 10
    Which is what you get by default.

    Minor tics are a separate command, but what you describe (I thiink) is also what you get by default.

     
    • Peter Gasparovic

      The syntax is set xtics <incr> | <start>, <incr> {,<end>}, so my command set xtics 10 is correct too, actually it is equivalent to your command set xtics 1.e6, 10.
      Neither your command nor my command produce meaningful x-axis tics. Only default setting of xtics (no command) produces correct tics on x-axis, even though the default settins should be eqivalent to:
      set xtics 10
      or
      set xtics 1e6,10
      or
      set xtics 1e6,1e8

       
      • Ethan Merritt

        Ethan Merritt - 2026-02-14

        Hmm. OK. I saw something else initially but now I can reproduce your report. I don't know what is going on here.

         
  • Ethan Merritt

    Ethan Merritt - 2026-02-20
    • status: open --> pending-fixed
     
  • Ethan Merritt

    Ethan Merritt - 2026-02-20

    It turns out that the failure was due to round-off error in testing initial tickmark placement against the range endpoints. After adding an allowance for floating-point round-off to integer values everything seems to be working.

     

Log in to post a comment.

MongoDB Logo MongoDB