PlotPCA shows small plot in plot section of R studio
1
0
Entering edit mode
2.3 years ago
synat.keam ▴ 100

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 • 1.7k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

Hi Trivas,

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

Thanks,

SK

ADD REPLY
2
Entering edit mode
2.3 years ago
4galaxy77 2.9k

Try removing coord_fixed()

ADD COMMENT
1
Entering edit mode

Dear Galaxy,

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

Kind Regards,

Synat,

ADD REPLY

Login before adding your answer.

Traffic: 2059 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6