The functions scale_x_discrete() and scale_y_discrete() are used to customize discrete x and y axis, respectively. Just define your own breaks.
scale_x_discrete(name, breaks, labels, limits)
scale_y_discrete(name, breaks, labels, limits)
- name : x or y axis labels
breaks : control the breaks in the guide
(axis ticks, grid lines, …). Among the possible values, there are :
NULL : hide all breaks waiver() : the default break computation a character or numeric vector specifying which breaks
to display
labels : labels of axis tick marks. Allowed values are : NULL for no labels waiver() for the default labels character
vector to be used for break labels
- limits : a character vector indicating the data
range
Reference this link