Hi y'all!
I'm trying to change the graduation of the x axis of a graph I've done.
Here is the code I used to have my graph:
library(ggplot2)
library(tidyr)
library(tidyverse)
#Creating a data that will be used to plot the monhtly values
datatoplot <- monthly %>%
gather(Legend, Value, -Date)
#Plotting the graph
ggplot(datatoplot, aes(x = Date, y = Value, fill = Legend)) +
geom_bar(position = "dodge", stat = "identity") + theme_bw()
The x axis gives 2016, 2018,2020... when I really would like it to gives also the month, as it is a plot plotting monthly maximum and minimum.
here is my data.
MonthlyMax MonthlyMin Date
1: 70.4 55.2 2015-01-01
2: 74.7 56.3 2015-02-01
3: 77.5 61.8 2015-03-01
4: 82.9 63.1 2015-04-01
5: 88.5 77.8 2015-05-01
6: 89.5 83.9 2015-06-01
7: 89.5 81.5 2015-07-01
8: 91.9 81.0 2015-08-01
9: 87.6 79.7 2015-09-01
10: 85.1 69.6 2015-10-01
11: 81.9 64.7 2015-11-01
12: 75.6 -99.0 2015-12-01
13: 72.0 40.2 2016-01-01
14: 75.5 48.9 2016-02-01
15: 76.2 -99.0 2016-03-01
16: 82.9 71.0 2016-04-01
17: 87.8 -99.0 2016-05-01
18: 89.9 80.2 2016-06-01
19: 91.7 83.0 2016-07-01
20: 89.1 80.6 2016-08-01
21: 90.4 -99.0 2016-09-01
22: 85.6 75.7 2016-10-01
23: 81.3 -99.0 2016-11-01
24: 75.5 58.4 2016-12-01
25: 73.5 58.4 2017-01-01
26: 71.3 51.7 2017-02-01
27: 75.4 60.9 2017-03-01
28: 82.7 66.9 2017-04-01
29: 85.8 75.9 2017-05-01
30: 88.8 80.2 2017-06-01
Thanks for the help!