3
$\begingroup$

How do I extract the AspectRatio from a plot? (For example for the PlotRange, I can use PlotRange[plot]. The same does not work for the AspectRatio.)


I would be happy to extend this question into how to extract various options and attributes of plots. See for example also this question/answer about extracting viewpoints.

$\endgroup$
1

1 Answer 1

13
$\begingroup$

For example:

p1 = Plot[Sin[x], {x, 0, π}]
AbsoluteOptions[p1, AspectRatio]

{AspectRatio -> 0.618034}

If this number looks familiar, it is because the default AspectRatio is 1/GoldenRatio // N.

$\endgroup$
1
  • 1
    $\begingroup$ ctrl-shift-e converts any graphic into its raw expression where you can look up a wide range of values, copy them, use them in options, etc. $\endgroup$
    – Rogo
    Apr 30, 2023 at 18:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.