When I use R’s curve() function, is there a way to force it to use the same scale on the X and the Y axis?
For example, consider this R code
mean <- 5
variance <- 0.05
curve(exp((((x - mean) / variance)^2) * -0.5), mean - 2, mean + 2)
This will give me this plot:

As you can see, the X axis and the Y axis use different scales. How can I fix this?
Note: I know I can manually specify the range of the Y axis (via ylim=) but I’d rather not use this (as this would require adopting it whenever the function changes).
You want the
aspplotting parameter, for aspect ratio. Setasp = 1in the call tocurve():That will do it.
It is not quite perfect if you want
xlim == ylimor if you want better labelling of the axes, butaspgets the same scale on both axes.