Thursday, 24 May 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

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print ...