[R] Plotting bar charts by Month

Jeff Reichman reichmanj at sbcglobal.net
Wed May 10 03:55:27 CEST 2017


r-help

 

Trying to figure out how to plot by month bar charts. The follow code plots
the monthly portion on a yearly x-scale.  So I either I create 12 individual
month plots or maybe there is some sort of "break" to tell R separate by
month and use the months dates as the x-scale; so that Jan's scale is 1 - 31
Jan , Feb scale is 1 - 28 Feb etc.  As it is now I get the Jan values ploted
with a 1-Jan to 31 Dec x-scale; Feb's value are ploted on a 1-Jan to 31 Dec
x-scale etc.

 

ggplot(data = df, aes(x = date, y = height)) +

        geom_bar(stat = "identity") +

        geom_bar(aes(x = action, y = height), color = "red", stat =
"identity") +

        facet_wrap(~month, nrow = 3)

 

Jeff


	[[alternative HTML version deleted]]



More information about the R-help mailing list