Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm analyzing numeric data with values between 1 to 7. I want to plot boxplots and show the significance across categories. My problem is that adding the labels also extends the values in the y axis. This might imply that the possible data range is up to more than 7 - which is not the best. I tried using ylim() but using it cuts off the signif labels. Is there a way to make the axis values to be 1-7, without cutting the information the should apear beyond this range?

my current plot:

current plot

when using ylim()

using ylim()

the desired outcome is something like that:

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
549 views
Welcome To Ask or Share your Answers For Others

1 Answer

As mentioned in the comments, the solution is setting breaks: gboxplot(...)+ scale_y_continuous(breaks = seq(0, 7, by = 1))


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...