Navigation

Operators and Keywords

Function List:

C++ API

: plot_box_aspect_ratio = pbaspect ( )
: pbaspect (plot_box_aspect_ratio)
: pbaspect (mode)
: plot_box_aspect_ratio_mode = pbaspect ("mode")
: pbaspect (hax, …)

Query or set the plot box aspect ratio of the current axes.

The aspect ratio is a normalized 3-element vector representing the rendered lengths of the x, y, and z axes.

pbaspect(mode)

Set the plot box aspect ratio mode of the current axes. mode is either "auto" or "manual".

pbaspect ("mode")

Return the plot box aspect ratio mode of the current axes.

pbaspect (hax, …)

Operate on the axes in handle hax instead of the current axes.

See also: axis, daspect, xlim, ylim, zlim.

Demonstration 1

The following code

 clf;
 x = 0:0.01:4;
 plot (x,cos(x), x,sin(x));
 pbaspect ([1 1 1]);
 title ("plot box is square");

Produces the following figure

Figure 1

Demonstration 2

The following code

 clf;
 x = 0:0.01:4;;
 plot (x,cos(x), x,sin(x));
 pbaspect ([2 1 1]);
 title ("plot box aspect ratio is 2x1");

Produces the following figure

Figure 1

Demonstration 3

The following code

 clf;
 x = 0:0.01:4;
 plot (x,cos(x), x,sin(x));
 daspect ([1 1 1]);
 pbaspect ([2 1 1]);
 title ("plot box is 2x1, and axes [0 4 -1 1]");

Produces the following figure

Figure 1

Package: octave