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

Miluji Sb m||uj|@b @end|ng |rom gm@||@com
Mon Apr 30 15:13:23 CEST 2018


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 <r.e.crump using warwick.ac.uk> wrote:

> 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 some work to be done to get the weekly mean
> into a legend, but it is achievable if required.
>
> Ron.
>

	[[alternative HTML version deleted]]




More information about the R-help mailing list