Re: [R] Overlay line on a bar plot - multiple axis

2018-04-30 Thread Miluji Sb
Dear Jim and Ron, Thank you very much. Both the solutions are very neat and working. Appreciate all your help. Sincerely, Milu On Mon, Apr 30, 2018 at 12:28 PM, Ron Crump wrote: > Hi Miluji, > > Using Jim's interpretation of your desired graph, > you could do it in ggplot2 using your dat DF b

Re: [R] Overlay line on a bar plot - multiple axis

2018-04-30 Thread Ron Crump
Hi Miluji, Using Jim's interpretation of your desired graph, you could do it in ggplot2 using your dat DF by: ggplot() + geom_bar(data=dat, aes(x=week,y=count,fill=city),stat="identity",position="dodge") + coord_flip() + geom_line(data=dat, aes(x=week, y=mean_tmin)) There would still need

Re: [R] Overlay line on a bar plot - multiple axis

2018-04-29 Thread Jim Lemon
Hi Miluji, You have a problem as the x-axis is different for the two plots. However, the y-axis can be the same, so you really don't need different axes. I think you want to display city within week. The example below shows how to display both the counts for the cities by week, the mean z by week a

[R] Overlay line on a bar plot - multiple axis

2018-04-29 Thread Miluji Sb
Dear all, I am trying to make a similar plot - https://peltiertech.com/images/2013-09/BarLineSampleChart4.png. I have data for two variables; count and z by city and week. I would like to have a horizontal bar plot of *count* by city and a line plot of weekly average of the variable *z*. I have