I am struggling to understand why ggplot and plot are producing slightly different plots of the same data. ggplot is including inf values up top, while plot isn't.
with(geneFDR, plot(log2(FC), -log10(FDR), pch=20, main="FDR vs. Real FC",
col=geneFDR$FDRColor))

ggplot(data=geneFDR, aes(x=log2(FC), y=-log10(FDR), color=FDRFCthreshold)) +
  geom_point(alpha=0.4, size=1.75) +
  ggtitle("FDR vs. Real Fold Change") +
  xlab("log2 Real Fold Change") + ylab("-log10(FDR)")

Source of inf values:
min(geneFDR$FDR)
[1] 0
max(geneFDR$FDR)
[1] 0.009883703
min(-log10(geneFDR$FDR))
[1] 2.00508
max(-log10(geneFDR$FDR))
[1] Inf
How is the default plot function handling inf values differently than ggplot?
try
scale_y_continuous(oob=scales::discard)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With