title: How can I test whether a plot has a fixed aspect ratio in R
body: <p>I wonder if there is a way to ask R whether a plot has or has not a fixed aspect ratio. Here are two example plots:</p>
  
  <pre><code>library (ggplot2)
  
  plot_a &lt;- ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
            geom_point()+
            theme (aspect.ratio = 1)
  
  plot_b &lt;- ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
            geom_point()
  </code></pre>
  
  <p>Whereas <code>plot_a</code> has a fixed aspect ratio, <code>plot_b</code> has no fixed aspect ratio. I am in search of the following imaginary function:</p>
  
  <pre><code>is_fixed_ratio (plot_a) 
  TRUE
  
  is_fixed_ratio (plot_b)
  FALSE
  </code></pre>
  
  <p>Is there a way to accomplish this?</p>