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) 

enter image description here

then try force xlim , ylim arguments fixed (?plot.pca)

plot.pca(out, choix="ind", xlim=c(-6,6), ylim=c(-4, 4)) 

enter image description here

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

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -