Skip to content

Boxplot plot range

2 messages · Scott Rifkin, Andy Bunn

#
How can I set the plot range for a boxplot using the boxplot() function?

For example, the values in the boxplot go from -3 to 3 (outliers plotted), 
but I'd like the y axis to go from -5 to 5.

Thanks much
Scott dot Rifkin at yale dot edu
#
How about using ylim?

foo <- rnorm(100, 0, 1)
boxplot(foo, ylim = c(-5, 5))

HTH, Andy