1

The basic principle to set automatic range and automatic tics is clear:

  1. get the minimum and the maximum of the plotted data
  2. round to next "nice" numbers
  3. set suitable "nice" intervals

Sounds easy, but I guess there is much more behind in gnuplot's algorithm. How does gnuplot get to these values in more detail?

In principle, I could lookup the source code, however, first of all I don't know which source file to look at and I have no clue from C code. Nevertheless, where to find the specific code (or even better a understandable description) how gnuplot gets to the automatic minimum and maximum tic and the automatic tic intervals? Thank you for any hints.

Reasoning behind this question: In some cases gnuplot's algorithm does not deliver good results which need to be tweaked (see code there). So, by understanding how gnuplot's algorithm works I want to try to automatically get to better results. enter image description here

theozh
  • 22,244
  • 5
  • 28
  • 72
  • 1
    See my answer https://stackoverflow.com/a/25989366/2604213 for a gnuplot equivalent of the tic step selection code in C. There you also find a link to the actual C code, which in this case is straightforward. – Christoph Mar 27 '19 at 17:01
  • thank you very much for the link to your code and the updated link directly to the c code! This saved me a lot of time searching. I will check and try to understand both codes. – theozh Mar 27 '19 at 18:42

0 Answers0