Credits Overview Plotting Styles Commands Terminals

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.

Historical note: In early versions of gnuplot some terminal types used set size to control also the size of the output canvas. Now there are two distinct properties: 'set size' and 'set term ... size'.

set term <terminal_type> size <x units>, <y units> controls the size of the output file, or canvas. Please see individual terminal documentation for the units of the size parameters. By default, the plot will fill this canvas.

set size <xscale>, <yscale> scales the plot itself relative to the size of the canvas. Scale values less than 1.0 cause the plot to fill only part of the canvas. This can be used together with multiplot to inset a small plot inside a larger plot or to place several small plots side-by-side. Scale values greater than 1.0 are not supported and may cause errors.

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 length along on both the x and y axes is the same; i.e. they are isotropic. See also set isotropic. This is the 2D equivalent to the 3D command set view equal xy. If <r>=-2, the unit on y has twice the length of the unit on x, and so on. See also set isotropic.

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).

set size square is a synonym for set size 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