# Use abbreviate as a formatter to reduce long names ggplot (mpg, aes (reorder (manufacturer, displ), cty)) + geom_point + scale_ x _discrete (labels = abbreviate) Contents ggplot2 is a part of the tidyverse , an ecosystem of packages designed with common APIs and a shared philosophy.
Position scales for discrete data. scale_ x _discrete() and scale_y_discrete() are used to set the values for discrete x and y scale aesthetics. For simple manipulation of scale labels and limits, you may wish to use labs() and lims() instead.
ggplot(my_dat, aes(x, y)) + geom_jitter(width = 0.4, color = blue) + geom_jitter(width = 0.5, color = red) As for the expand = … parameter in scale_x_discrete / coord_cartesian, they do make a difference… if your axis has more than 1 value:, Use the convenience function expand _scale() to generate the values for the expand argument. The defaults are to expand the scale by 5% on each side for continuous variables, and by 0.6 units on each side for discrete variables. position: The position of the axis. left or right for y axes, top or bottom for x axes, Position scales for discrete data scale_x_discrete ggplot2, r – How does ggplot scale_continuous expand argument work …
r – How does ggplot scale_continuous expand argument work …
Position scales for discrete data scale_x_discrete ggplot2