How to access Gnuplot's (auto)range values and modify them to add some margin?

Matthias picture Matthias · Sep 7, 2011 · Viewed 13.8k times · Source

Using the standard plot command, I get, what I want except that the yrange is set automatically from (eg) 275 to 300.

Unfortunately, I have several data points with y-coordinate 300, such that they are not visible (due to border lines, etc.).

So, is there any way to set the maximum yrange such that it is always the maximum data plus e.g. 5 units?

Using autoscale, the yrange is set to 275:300. Setting explicitly the range to 275:305 would work for one data file but not for others. So I need some generic method to determine the max-data point and set the yrange larger.

Answer

Sunhwan Jo picture Sunhwan Jo · Sep 7, 2011
set offsets <left>, <right>, <top>, <bottom>

will do. Note the scale follows the data scale, so it will eventually depend on the data you want to plot. Alternatively, you can use set offsets graph ... to use fraction of the plot size instead.