开发者

ggplot: How to override the ylim interval?

开发者 https://www.devze.com 2023-01-15 07:27 出处:网络
I have a faceted plot (about which I had this other question). I would like to control the interval of ylim() to reduce the clutter because it looks like this:

I have a faceted plot (about which I had this other question). I would like to control the interval of ylim() to reduce the clutter because it looks like this:

ggplot: How to override the ylim interval?

It's too detailed and I would like to display only 0 and 500, that is not even the maximum (the thin horizontal lines are enough). The reasons I want only those 2 values are:

  • reduce the granularity (the values every 200 are crammed vertically)
  • by avoid 1000 there will be more space开发者_如何学Go between 0 and the next value belonging to the facet plot below.

Thanks in advance.


just add the following to your code. you can tweak it based on what labels you want displayed on the y-axis.

scale_y_continuous(breaks = c(0, 500))
0

精彩评论

暂无评论...
验证码 换一张
取 消