This is a test version of Biostars. For the public version, visit https://www.biostars.org.
PlotPCA shows small plot in plot section of R studio

Dear all,

Anyone has any idea why plotPCA shows smaller plot in R studio. Even though I tried to save it, but it did not work. I wanted to make the height a bit taller. Anyone can help fix? thank in advance!

Synat,

pcaData <- plotPCA(vsd, intgroup=c("Group", "Treatment"), returnData=TRUE)
percentVar <- round(100 * attr(pcaData, "percentVar"))
pca<- ggplot(pcaData, aes(PC1, PC2, color=Group, shape=Treatment)) +
  geom_point(size=3) + theme_minimal() +
  xlab(paste0("PC1: ",percentVar[1],"% variance")) +
  ylab(paste0("PC2: ",percentVar[2],"% variance")) + 
  coord_fixed() + geom_point(size=4) +
labs(title = "Principle Component Analysis") + 
  theme(plot.title = element_text(hjust = 0.5, face = "bold", size = 14), 
        axis.text = element_text(face = "bold", size=12), axis.title = element_text(face = "bold", size=13),
        legend.title = element_text(size = 13, face = "bold"), legend.text = element_text(size = 12))

enter image description here

deseq2 plotpca

You already got a solution, but you have duplicate geom_point calls with different sizes that you might want to combine.

Hi Trivas,

thanks you for your suggestion. I will try your idea.

Thanks,

SK

1 answer

Try removing coord_fixed()

Dear Galaxy,

It worked so well. I wish I have thought about it. Thank for your help.

Kind Regards,

Synat,

Log in to answer this question.