dfernan
dfernan

Reputation: 387

Gnuplot: trailing white space

I've got a multiplot like this:

Plot sample

How do I remove the trailing white space added by the xtics interval? Relevant configurations include:

set xtics 10
set mxtics 5

Data for the xaxis goes up to somewhere between 135 and 140.

Thanks.

Upvotes: 4

Views: 827

Answers (2)

Christoph
Christoph

Reputation: 48390

To disable the automatic extension of the autoscaled x-axis to the next tic mark use

set autoscale xfix

The general syntax is

set autoscale {<axes>{|min|max|fixmin|fixmax|fix} | fix | keepfix}

Upvotes: 2

andyras
andyras

Reputation: 15910

You have to set your xrange explicitly if the data do not end at some nice round value. One way to do this is to use the stats command (gnuplot 4.6.0) and up:

stats 'data.dat'
set xrange[STATS_min_x:STATS_max_x]

Otherwise you can set xrange manually (if you know the value), or use the old-fashioned method:

set output '/dev/null'
plot 'data.dat'
set xrange[GPVAL_DATA_X_MIN:GPVAL_DATA_X_MAX]
set output'actual_output.png'
replot

Upvotes: 2

Related Questions