Thursday, May 24, 2018

r - formatting y axis range in ggplot

here is my code



library(tidyverse)

df <- tribble(~percentage, ~session,

81,1,
79,2,
68,3,
75,4,
63,5,
55,6,
49,7,
44,8,
41,9,
32,10)


library(ggplot2)

ggplot(aes(x = session, y = percentage), data = df) +
geom_line()+
geom_point()+
scale_x_continuous(breaks = seq(0,10,by = 1))


and resultant graph is as follows

enter image description here



Here, Y-axis is from range 30 to 80. But I want it from 0 to 100. Thanks in advance.

No comments:

Post a Comment

plot explanation - Why did Peaches&#39; mom hang on the tree? - Movies &amp; TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...