11ème rencontre des communes aux noms burlesques Differences in zooming or scaling in ggplot.
Read Full Article Either scale_y_continuous() or coord_cartesian() can be used but they work in slightly different way.
scale_y_continuous (or scale_x_continuous) will drop data which are out of the range, while coord_cartesian() won’t. It does not affect the plot if the plot is drawn only with the given data. However, if the plot includes processed data by ggplot, such as smoothing or histogram, the result may not the same.