Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

log scale boxplots in R

Tags:

r

For the plots I'm trying to generate, I want to apply log scale to the y axis.

The original code is

bxp(confSum, main="Mean Coverage Per Exon for Hiseq", ylab="Fold Coverage", 
    las=2, cex.lab=1, cex.axis=0.7,xaxt='n', ann=FALSE)

which works fine but not in log scale.

Based on some information online, I added log="y" to the code, and the pdf it produces just become empty with nothing on it...

Did I make a mistake somewhere?.. How should I fix it for log scale?

Thanks in advance.

like image 681
JJS Avatar asked Jun 20 '13 20:06

JJS


2 Answers

> boxplot(decrease ~ treatment, data = OrchardSprays,
+         log = "y", col = "bisque")
like image 114
Michele Avatar answered Oct 16 '22 22:10

Michele


I had the same issue. I figured out it was because my dataset had some zero values, so I substituted them for NA and it worked out. It's because boxplot function can't handle plotting the 0 values in the log scale (converges to infinite).

like image 36
Marina Vance Avatar answered Oct 16 '22 21:10

Marina Vance