Stata 15 help for aspect_option

[G-3] aspect_option -- Option for controlling the aspect ratio of the plot region

Syntax

aspect_option Description ------------------------------------------------------------------------- aspectratio(# [, pos_option]) set plot region aspect ratio to # -------------------------------------------------------------------------

pos_option Description ------------------------------------------------------------------------- placement(compassdirstyle) placement of plot region -------------------------------------------------------------------------

Description

The aspectratio() option controls the relationship between the height and width of a graph's plot region. For example, when #=1, the height and width will be equal (their ratio is 1), and the plot region will be square.

Option

aspectratio(# [, pos_option]) specifies the aspect ratio and, optionally, the placement of the plot region.

Suboption

placement(compassdirstyle) specifies where the plot region is to be placed to take up the area left over by restricting the aspect ratio. See [G-4] compassdirstyle.

Remarks

The aspectratio(#) option constrains the ratio of the plot region to #. So, if # is 1, the plot region is square; if it is 2, the plot region is twice as tall as it is wide; and, if it is .25, the plot region is one-fourth as tall as it is wide. The most common use is aspectratio(1), which produces a square plot region.

The overall size of the graph is not changed by the aspectratio() option. Thus constraining the aspect ratio will generally leave some additional space around the plot region in either the horizontal or vertical dimension. By default, the plot region will be centered in this space, but you can use the placement() option to control where the plot region is located. placement(right) will place the plot region all the way to the right in the extra space, leaving all the blank space to the left; placement(top) will place the plot region at the top of the extra space, leaving all the blank space at the bottom; placement(left) and placement(right) work similarly.

Specifying an aspect ratio larger than the default for a graph causes the width of the plot region to become narrower. Conversely, specifying a small aspect ratio causes the plot region to become shorter. Because titles and legends can be wider than the plot region, and because most schemes do not allow titles and legends to span beyond the width of the plot region, this can sometimes lead to surprising spacing of some graph elements; for example, axes may be forced away from their plot region. If this occurs, the spacing can be improved by adding the span suboption to the title(), subtitle(), legend(), or other options. The span option must be added to each element that is wider than the plot region. See Spanning in [G-3] title_options for a diagram.


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index