r - Set axis limits for plot.PCA - strange behaviour (FactoMineR) -
i want plot result of pca package factominer. when 1 plots pca practice resize graph h/l ratio in proportion %variance explained each axis.
so tried first resize graph stretching window: fails , keep points in middle instead of stretching them too.
library(factominer) out <- pca(mtcars)
then try force xlim
, ylim
arguments fixed (?plot.pca
)
plot.pca(out, choix="ind", xlim=c(-6,6), ylim=c(-4, 4))
same problem, xlim limits not respected...
can explain behaviour , knows how fix it?
what you're seeing result of call plot
inside plot.pca
:
plot(0, 0, main = titre, xlab = lab.x, ylab = lab.y, xlim = xlim, ylim = ylim, col = "white", asp = 1, ...)
plot
called parameter asp
set 1
, guarantees y/x ratio stays same, when try resize window, xlim
recomputed.
in plot.window
can find "meaning" of asp
:
if asp finite positive value window set 1 data unit in x direction equal in length asp * 1 data unit in 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 window, , same with
plot(0, 0, main = "", xlab = "", ylab = "", xlim = c(-6, 6), ylim = c(-4, 4), col = "white")
to see difference.
Comments
Post a Comment