Next: , Previous: samples, Up: set-show


3.24.60 size

Syntax:

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

The <xscale> and <yscale> 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
           size to control also the size of the output canvas; others did not.
           In version 4.4 almost all terminals now follow the following convention:
     

`set term <terminal_type> size <XX>, <YY>` 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 <XX>, <YY>` 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.

`ratio` causes `gnuplot` to try to create a graph with an aspect ratio of <r> (the ratio of the y-axis length to the x-axis length) within the portion of the plot specified by <xscale> and <yscale>.

The meaning of a negative value for <r> is different. If <r>=-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 <r>=-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 <r> 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 <xscale> or <yscale> to their default values (1.0).

`ratio` and `square` have no effect on 3D plots, but do affect 3D projections created using `set view map`. See also `set view equal`, which forces the x and y axes of a 3D onto the same scale.

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 airfoil demo.