AspectRatio

AspectRatio

is an option for Graphics and related functions that specifies the ratio of height to width for a plot.

Details

  • AspectRatio determines the scaling for the final image shape.
  • Typical settings include:
  • Automaticdetermine the ratio from the actual coordinate values
    Fullstretch graphics to fill out the enclosing region
    aan explicit height-to-width ratio

Examples

open allclose all

Basic Examples  (2)

Use numerical values to specify the height-to-width ratio:

Choose the ratio from the actual plot values:

Scope  (2)

Automatic can be given to choose the ratio from the actual plot values:

Specify the height-to-width ratio of a graphic by numerical values:

Generalizations & Extensions  (2)

In 3D, the aspect ratio determines the ratio of the final displayed 2D image:

Use the Automatic setting to preserve the natural 3D projection:

Properties & Relations  (5)

AspectRatio determines the ratio of PlotRange, not ImageSize:

Graphics uses Automatic by default:

Plot, ListPlot, and ListLinePlot use the ratio 1/GoldenRatio by default:

Some plots, such as ParametricPlot and ArrayPlot, use Automatic by default:

Others, such as DensityPlot and ContourPlot, use the ratio 1 by default:

Possible Issues  (2)

By default, ParametricPlot may yield a graphic with an extreme aspect ratio:

Use an explicit AspectRatio to get a reasonable result:

Using an explicit AspectRatio may distort shapes:

Use Automatic when shape distortion is undesirable:

Neat Examples  (1)

A collection of boxes with random aspect ratios:

Wolfram Research (1988), AspectRatio, Wolfram Language function, https://reference.wolfram.com/language/ref/AspectRatio.html (updated 2007).

Text

Wolfram Research (1988), AspectRatio, Wolfram Language function, https://reference.wolfram.com/language/ref/AspectRatio.html (updated 2007).

CMS

Wolfram Language. 1988. "AspectRatio." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2007. https://reference.wolfram.com/language/ref/AspectRatio.html.

APA

Wolfram Language. (1988). AspectRatio. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AspectRatio.html

BibTeX

@misc{reference.wolfram_2024_aspectratio, author="Wolfram Research", title="{AspectRatio}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/AspectRatio.html}", note=[Accessed: 11-October-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_aspectratio, organization={Wolfram Research}, title={AspectRatio}, year={2007}, url={https://reference.wolfram.com/language/ref/AspectRatio.html}, note=[Accessed: 11-October-2024 ]}