I want to plot the result of a PCA with the package factominer. When one plots a PCA it is good practice to resize the graph so that its H/L ratio is in proportion to the %variance explained by each axis.
So I tried first to resize the graph simply by stretching the window: it obviously fails and keep the points in the middle instead of stretching them too.
out <- PCA(mtcars)
plot.PCA(out, choix="ind", xlim=c(-6,6), ylim=c(-4, 4))
What you're seeing is the result of the call to
plot(0, 0, main = titre, xlab = lab.x, ylab = lab.y, xlim = xlim, ylim = ylim, col = "white", asp = 1, ...)
plot is called with parameter
asp set to
1, which guarantees that the y/x ratio stays the same, so when you try to resize the window, the
xlim are recomputed.
plot.window you can find the "meaning" of
If asp is a finite positive value then the window is set up so that one data unit in the x direction is equal in length to asp * one data unit in the y direction.
You can try
plot(0, 0, main = "", xlab = "", ylab = "", xlim = c(-6, 6), ylim = c(-4, 4), col = "white", asp = 1)
and resizing the window, and then the same with
plot(0, 0, main = "", xlab = "", ylab = "", xlim = c(-6, 6), ylim = c(-4, 4), col = "white")
to see the difference.