开发者

ggplot: How to override the ylim interval?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜