two graphs on the same plot

I have rainfall data and lake waterlevel data that I want to plot on the graph. I want to have the 'DATE' on the x-axis, 'RAINFALL' on one y-axis and 'WATERLEVEL' on the other y-axis. How do I go about doing this? Kindly assist

Ideally you don't do it. Double axes are very deceiving.

It is almost always better to do two plots and if necessary present them as two subplots using something like patchwork https://cran.r-project.org/web/packages/patchwork/index.html.

If you really need a double -axis plot have a look at https://www.r-graph-gallery.com/line-chart-dual-Y-axis-ggplot2.html for one way to do it.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.