2
votes

I've been going crazy looking for an answer to this question. How can I set the distance between the tics on gnuplot? Currently the tics in my plot are squished together too tightly. I want them to be more spread out.

Here is an example:

I have a graph that looks like this:

100 ——
      |
      |
 50 —— 
      |
      |
  0 ——

I want it to look like this:

 50 ——
      |
      |
      | 
      |
      |
  0 ——

Notice that there is actually one less tic in the after sample.

2
Do you not perhaps want the upper label in the second example to be 100 rather than 50? Or do you really want to zoom into the actual graph?Evgeniy Berezovsky

2 Answers

5
votes

The distance between tics is set by set xtics or set ytics command. For example if I use the command plot sin(x) then the space between the xtics is 5 by default. The command

  set xtics  -10,2,10
  replot

makes the xtics appear at an interval of 2. In the above command the format is

  set xtics <start>, <increment>, <end>

See help xtics inside gnuplot for details.

Hope this helps!

2
votes

As suggested in another answer by andyras (Change actual space between tics in gnu plot) you can do it by controlling the size of your terminal. I also had a problem, where I wanted the tics in the axis to have the same distance in absolute values (though I don't know the value itselft, but the grid should be quadratic in the end).

So if you want a quadratic grid/spacing of your tics, put

set terminal pdfcairo size 100, 100

For rectangular put

set terminal pdfcairo 100, 200

and so on. Again, this is an answer suggested by andyras, not me. I took his answer, which worked for my case.