01.02.2014 Views

GNUPlot Manual

GNUPlot Manual

GNUPlot Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

28 PLOT gnuplot 4.0 39<br />

28.1 Data-file<br />

Discrete data contained in a file can be displayed by specifying the name of the data file (enclosed in<br />

single or double quotes) on the plot command line.<br />

Syntax:<br />

plot ’’ {index }<br />

{every }<br />

{thru }<br />

{using }<br />

{smooth }<br />

The modifiers index, every, thru, using, and smooth are discussed separately. In brief, index selects<br />

which data sets in a multi-data-set file are to be plotted, every specifies which points within a single<br />

data set are to be plotted, using determines how the columns within a single record are to be interpreted<br />

(thru is a special case of using), and smooth allows for simple interpolation and approximation. (splot<br />

has a similar syntax, but does not support the smooth and thru options.)<br />

Data files should contain at least one data point per record (using can select one data point from the<br />

record). Records beginning with # (and also with ! on VMS) will be treated as comments and ignored.<br />

Each data point represents an (x,y) pair. For plots with error bars or error bars with lines (see set style<br />

errorbars (p. 98) or set style errorlines (p. 99)), each data point is (x,y,ydelta), (x,y,ylow,yhigh),<br />

(x,y,xdelta), (x,y,xlow,xhigh), or (x,y,xlow,xhigh,ylow,yhigh).<br />

In all cases, the numbers of each record of a data file must be separated by white space (one or more<br />

blanks or tabs) unless a format specifier is provided by the using option. This white space divides<br />

each record into columns. However, whitespace inside a pair of double quotes is ignored when counting<br />

columns, so the following datafile line has three columns:<br />

1.0 "second column" 3.0<br />

Data may be written in exponential format with the exponent preceded by the letter e, E, d, D, q, or Q.<br />

Only one column (the y value) need be provided.<br />

starting at 0.<br />

If x is omitted, gnuplot provides integer values<br />

In datafiles, blank records (records with no characters other than blanks and a newline and/or carriage<br />

return) are significant — pairs of blank records separate indexes (see plot datafile index (p. 40)).<br />

Data separated by double blank records are treated as if they were in separate data files.<br />

Single blank records designate discontinuities in a plot; no line will join points separated by a blank<br />

records (if they are plotted with a line style).<br />

If autoscaling has been enabled (set autoscale), the axes are automatically extended to include all<br />

datapoints, with a whole number of tic marks if tics are being drawn. This has two consequences: i) For<br />

splot, the corner of the surface may not coincide with the corner of the base. In this case, no vertical<br />

line is drawn. ii) When plotting data with the same x range on a dual-axis graph, the x coordinates may<br />

not coincide if the x2tics are not being drawn. This is because the x axis has been autoextended to a<br />

whole number of tics, but the x2 axis has not. The following example illustrates the problem:<br />

reset; plot ’-’, ’-’ axes x2y1<br />

1 1<br />

19 19<br />

e<br />

1 1<br />

19 19<br />

e<br />

To avoid this, you can use the fixmin/fixmax feature of the set autoscale command, which turns off<br />

the automatic extension of the axis range upto the next tic mark.<br />

28.1.1 Every<br />

The every keyword allows a periodic sampling of a data set to be plotted.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!