Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gnuplot: only integer values on axis x

How can I visualize on axis x only the integer values?

I plot the function described in a file like this

0   0.5
1   0.25
2   0.125
3   0.0625
4   0

whit these commands:

set xrange [0:4]
plot "./data_file" using 1:2 with line lw 2

The problem is that, by doing so, I visualize on axis x the values 0; 0.5; 1; 1.5; 2; 2.5; 3; 3.5; 4 How can I visualize only the integer values 0; 1; 2; 3; 4?

Thank you

like image 810
fibon82 Avatar asked May 02 '12 23:05

fibon82


1 Answers

help set

help set xtics

set xtics 1

as mgilson notes in the comments, set xtics with a single argument defines an increment for the x axis.

like image 191
andrew cooke Avatar answered Nov 13 '22 18:11

andrew cooke