Graphics Reference
In-Depth Information
Figure 8-6. Box plot with reversed y-axis
Discussion
Like
scale_y_continuous()
,
scale_y_reverse()
does not work with
ylim
. (The same is
true for the x-axis properties.) If you want to reverse an axis andset its range, you must do it
ggplot(PlantGrowth, aes(x
=
group, y
=
weight))
+
geom_boxplot()
+
scale_y_reverse(limits
=
c(
8
,
0
))
Figure 8-7. Box plot with reversed y-axis with manually set limits