I am using DESeq2 for gene expression analysis. I have 3 different conditions which I am normalizing to my control so I have produced 3 different PCA plots for my data. For some reason one of my conditions (B) keeps automatically adjusting its shape when I stretch my figure window in R studio. This was the code I originally used to produce these figures:
> pcaData <- plotPCA(vsd, intgroup=c("condition", "type"), returnData=TRUE)
> percentVar <- round(100 * attr(pcaData, "percentVar"))
> ggplot(pcaData, aes(PC1, PC2, color=condition, shape=type)) +
+ geom_point(size=4) +
+ xlab(paste0("PC1: ",percentVar[1],"% variance")) +
+ ylab(paste0("PC2: ",percentVar[2],"% variance")) +
+ coord_fixed()
I then tried to adjust my axis limits by adding "scale_x_continuous(limits = c(-50,70))" so my code now looks like this:
> pcaData <- plotPCA(vsd, intgroup=c("condition", "type"), returnData=TRUE)
> percentVar <- round(100 * attr(pcaData, "percentVar"))
> ggplot(pcaData, aes(PC1, PC2, color=condition, shape=type)) +
+ geom_point(size=4) +
+ xlab(paste0("PC1: ",percentVar[1],"% variance")) +
+ ylab(paste0("PC2: ",percentVar[2],"% variance")) +
+ scale_x_continuous(limits = c(-50,70)) +
+ coord_fixed()
But my figures still look off, I noticed that my quadrants in (A) and (C) look rectangular but more square in (B). For publication purposes I would look to have 3 uniform images.
Use cowplot.
...and then play with the parameters until it looks well-aligned.
There is some tweaking that can be done, but not much you can do when values are on different scales.
A numerical spread of principal components is what it is, and you have no control over it. In your panel C PC1 values seem to be in the -70 to +70 range, while they are -50 to +70 in panel B. The range difference on the Y axis is even more dramatic. If you force the size of your coordinate system to be the same in all images - that will line them up perfectly - there will be empty areas at the edges of some images but not the others.
OP could also distort the sizes of the grids to force them all to have the same dimensions, but this will make distances mean different things on different graphs. This may or may not be misleading.