r - label y axis in one week increments ggplot2 -
I want to produce a graph which is available every year from April to June by y code to ggplot2
.
Here's my data:
df < - structure (list (year = structure (1:11, .label = C ("2000", "2001", "2003", "2004", "2005", "2006", "2007", "2008" "2009", "2010"), class = "factor"), greenups_mean = c (107, 106, 124, 107, 119, 112, 103, 113, 133, 127, 109), greenups.dtime = structure (11063, 11428, 11811, 12159, 12536, 128 9, 13251, 13626, 14011, 14371, 14718), class = "date"), GMD = C ("04-16", "04-16", "05-04", "04-17", "04-28", "04-22", "04-13", "04-23", "05-12", "05-07", "04 -19 "), line.Name = C (NA, -11L), class =" data.frame ", .name = c (" year "," greenhops_men "," greenups dictate "," GMD "))
I can make a decent line graph. I use the df $ greenups_mean
which is the day of the year, on the y-axis.
Library (ggplot2) p & lt; - ggplot (df, aes (x = year, y = greenups_mean)) + geom_line (AES (group = 1)) P < - p + ylab ('green-up') + xlab ('year') p
However, instead of labeling the y-axis with the day of the year, I want to label it weekly from April 1st until 1st June. I think I have to send the discrete label to the conspiracy?
Thanks
--Crittry
change yaxis For this way, scale_y_continuous
p
The boundaries for those exact dates and breaks
may be slightly off, but this is the basic idea.
Comments
Post a Comment