Menu

#2372 Wrong minor ticks drawn in logscale when major ticks are separated by 10²

None
closed-not-a-bug
nobody
None
2024-06-22
2020-12-04
Anonymous
No

This is as easy to reproduce on v5.2.8 (windows) as with

set logscale y; plot [1:20] 10**x

The ticks are drawn in what seems like completely random places! (As in the attachment: pay attention to the mouse coordinates; here the mouse is aligned with the bottom minor tick. This tick is 54px above, and 48 px below the surrounding major ticks.


Ilya Zakharevich nospam-abuse@ilyaz.org

1 Attachments

Discussion

  • Ethan Merritt

    Ethan Merritt - 2020-12-06

    not random.

    Remember that minor tics are specified in terms of how many between adjacent major tics. That gets a little weird for logscale tics because there is no tic for "1" (= log(0)). If the major tics are one log increment apart, you get minor tics as 2,3,4,5,6,7,8,9 with log-scaled spacing. That makes intuitive sense. If the major tics are two log increments apart, as they are here, then you still get the same number and placement of tics but it no longer makes intuitive sense.
    [shrug]
    Honest question: What do you think the program should do instead?
    - not draw minor ytics at all?
    - always choose "set ytics 10" even though it will make the y axis very crowded?
    - something else?

     
  • Ethan Merritt

    Ethan Merritt - 2020-12-30
    • status: open --> closed-not-a-bug
    • Group: -->
    • Priority: -->
     
  • Ethan Merritt

    Ethan Merritt - 2020-12-30

    I think this is not a bug, because I don't think there is any reasonable set of positions for minor tics in this case.

     
  • Ilya Zakharevich

    First, there are obvious reasonable positions for the ticks. For me, your statement is absolutely incredible: how do you think scientists managed to draw plots in log-scale (for centuries!)? I address the skeleton of an algorithm in #2717.

    Second, you seem to ignore the part of the report about “the ticks being drawn at random places”. To see, put the mouse on the tick, and read its coordinate aloud. If “your conjecture” would be write, you would get a square of the corresponding digit (or a cube, etc). It is not. For example, on the plot below the first tick after 1 is at12768 instead of 32 expected with your “explanation”.

    Anyone who have seen correct log-plots would recognize that positions of these ticks are not “just linearly-scaled positions of log-ticks”:

    set autoscale noextend; set logscale xy; plot [0.9:0.9e33] x
    

    BTW: Currently, in gnuplot the placement of ticks in any non-trivial situation seems to be completely broken. I know many (tens of ?) examples. (See e.g. #2399.)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.