I tried to change y-axis scale range.
I used the code to set the y scale:
coord_cartesian(ylim = c(min(value) - 0.05, max(value) + 0.05))
where value
is a numeric column.
I want the y-axis showing from the minimum of value
minus 0.05
to maximum of value
plus 0.05
with the breaks of 0.05
.
However, coord_cartesian()
does not work. Alternatively, I tried scale_y_continuous(breaks(min(value) - 0.05, max(value) + 0.05, 0.05))
, it does not work either.
How to edit my code?