2
votes

I have some data files that I need to plot. Im setting xtic to the 1st column, which contains large number, i.e., 1000 000, 2000 000, .., 10 000 0000 using the command:

plot  "vec.dat" using 1:2:xtic(1) title 'line 1' with linespoints, 

However, x-axis looks ugly, as such large numbers are being displayed in the x-axis. Im interested in showing only percentage of such values, how can this be done in gnuplot?

thanks in advance

1

1 Answers

2
votes

You can either scale all x value and add the scaling to the x label:

set termoption enhanced
set xlabel 'Values in 10^{6}'
plot "vec.dat" using ($1*1e-6):2 title 'line 1' with linespoints

or you can change the xtics format with

set termoption enhanced
set format x '%.1t 10^{%T}'
plot "vec.dat" using 1:2 title 'line 1' with linespoints

I would definitely prefer the first version. I don't see any reason for using xtic in your case.