Graphics Reference
In-Depth Information
Figure 8-9. Box plot with order reversed on the x-axis
See Also
To reorder factor levels based on data values from another column, see Changing the Order of
Factor Levels Based on Data Values .
Setting the Scaling Ratio of the X- and Y-Axes
Problem
You want to set the ratio at which the x- and y-axes are scaled.
Solution
Use coord_fixed() . This will result in a 1:1 scaling between the x- and y-axes, as shown in
Figure 8-10 :
library(gcookbook) # For the data set
sp <- ggplot(marathon, aes(x = Half,y = Full)) + geom_point()
sp + coord_fixed()
Search WWH ::




Custom Search