Vote count: 0
I'd like to draw a combo graph where
- the x-axis is the hour of the day
- Two lines represent the average value of each hour
- A filled area represents the volume of the data points of each hour
- Two y-axis as the units of the avg. value and the count are different
here's some fake data:
data = data.frame(x_hour=c(8,9,10,11,12,13,14,15),
y_linea=c(3,7,6,8,14,16,18,12),
y_lineb=c(3,5,12,7,4,6,19,9),
y_count=c(50,70,120,60,85,48,36,70))
and here's the ideal picture I wanted to draw
My thought was to draw two separate graphs and combine them together, but I cannot figure out how to create the graph with the area or how to combine those two graphs. I would appreciate it a lot if you could share your ideas with me, thank you!
asked 47 secs ago
how to use ggplot in R to draw a single graphic with two lines and one area with duo y axis?
Aucun commentaire:
Enregistrer un commentaire