next up previous contents index
Next: Style Up: Set-show Previous: Samples   Contents   Index


Size

Syntax:
     set size {{no}square | ratio <r> | noratio} {<xscale>,<yscale>}
     show size

The 5#5xscale6#6 and 5#5yscale6#6 values are scale factors for the size of the plot, which includes the graph, labels, and margins.

Important note:

     In earlier versions of gnuplot, some terminal types used the values from
     `set size` to control also the size of the output canvas; others did not.
     In version 4.2 most terminals now follow the convention described below.
     However, see `backwards compatibility` for the png/gif/jpeg drivers.

set term 5#5terminal_type6#6 size 5#5XX6#6, 5#5YY6#6 controls the size of the output file, or canvas. Please see individual terminal documentation for allowed values of the size parameters. By default, the plot will fill this canvas.

set size 5#5XX6#6, 5#5YY6#6 scales the plot itself relative to the size of the canvas. Scale values less than 1 will cause the plot to not fill the entire canvas. Scale values larger than 1 will cause only a portion of the plot to fit on the canvas. Please be aware that setting scale values larger than 1 may cause problems on some terminal types. See set term size (p. [*]).

ratio causes gnuplot to try to create a graph with an aspect ratio of 5#5r6#6 (the ratio of the y-axis length to the x-axis length) within the portion of the plot specified by 5#5xscale6#6 and 5#5yscale6#6.

The meaning of a negative value for 5#5r6#6 is different. If 5#5r6#6=-1, gnuplot tries to set the scales so that the unit has the same length on both the x and y axes (suitable for geographical data, for instance). If 5#5r6#6=-2, the unit on y has twice the length of the unit on x, and so on.

The success of gnuplot in producing the requested aspect ratio depends on the terminal selected. The graph area will be the largest rectangle of aspect ratio 5#5r6#6 that will fit into the specified portion of the output (leaving adequate margins, of course).

square is a synonym for ratio 1.

Both noratio and nosquare return the graph to the default aspect ratio of the terminal, but do not return 5#5xscale6#6 or 5#5yscale6#6 to their default values (1.0).

ratio and square have no effect on 3-d plots.

Examples:

To set the size so that the plot fills the available canvas:

     set size 1,1

To make the graph half size and square use:

     set size square 0.5,0.5

To make the graph twice as high as wide use:

     set size ratio 2

See also

http://www.gnuplot.info/demo/airfoil.htmlairfoil demo.


next up previous contents index
Next: Style Up: Set-show Previous: Samples   Contents   Index
Ethan Merritt 2007-03-03