Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
You can use xlim() or ylim() to set the minimum and maximum values
of a continuous axis. Figure 8-3 shows one graph
with the default y limits, and one with manually
set y limits:
p<-ggplot(PlantGrowth,aes(x=group,y=weight))+geom_boxplot()# Display the basic graphp p+ylim(0,max(PlantGrowth$weight))
The latter example sets the y range from 0
to the maximum value of the weight
column, though a constant value (like 10) could instead be used as the
maximum.