Syntax:
title <text> | notitle [<ignored text>] title columnheader | title columnheader(N) {at {beginning|end}} {{no}enhanced}
where 4#4text5#5 is a quoted string or an expression that evaluates to a string. The quotes will not be shown in the key. Note: Starting with gnuplot version 5.4, if 4#4text5#5 is an expression or function it it evaluated after the corresponding function or data stream is plotted. This allows the title to reference quantities calculated or input during plotting, which was not possible in earlier gnuplot versions.
There is also an option that will interpret the first entry in a column of input data (i.e. the column header) as a text field, and use it as the key title. See datastrings (p. ). This can be made the default by specifying set key autotitle columnhead.
The line title and sample can be omitted from the key by using the keyword notitle. A null title (title ' ') is equivalent to notitle. If only the sample is wanted, use one or more blanks (title ' '). If notitle is followed by a string this string is ignored.
If key autotitles is set (which is the default) and neither title nor notitle are specified the line title is the function name or the file name as it appears on the plot command. If it is a file name, any datafile modifiers specified will be included in the default title.
The layout of the key itself (position, title justification, etc.) can be controlled using set key (p. ).
The at keyword allows you to place the plot title somewhere outside the auto-generated key box. The title can be placed immediately before or after the line in the graph itself by using at {beginning3#3end}. This option may be useful when plotting with lines but makes little sense for most other styles.
To place the plot title at an arbitrary location on the page, use the form at 4#4x-position5#5,4#4y-position5#5. By default the position is interpreted in screen coordinates; e.g. at 0.5, 0.5 is always the middle of the screen regardless of plot axis scales or borders. The format of titles placed in this way is still affected by key options. See set key (p. ).
Examples:
This plots y=x with the title 'x':
plot x
This plots x squared with title "x^
2" and file "data.1" with title
"measured data":
plot x**2 title "x^2", 'data.1' t "measured data"
Plot multiple columns of data, each of which contains its own title on the first line of the file. Place the titles after the corresponding lines rather than in a separate key:
unset key set offset 0, graph 0.1 plot for [i=1:4] 'data' using i with lines title columnhead at end
Create a single key area for two separate plots:
set key Left reverse set multiplot layout 2,2 plot sin(x) with points pt 6 title "Left plot is sin(x)" at 0.5, 0.30 plot cos(x) with points pt 7 title "Right plot is cos(x)" at 0.5, 0.27 unset multiplot