I'm wondering how to best display revenue vs. profit over time in ggplot2. In Excel, I would simply do a secondary y-axis and all is fine. However, ggplot2 isn't really flexible in that regard and using the factor for the secondary axis (in sec.axis) doesn't work.
Do you have any idea how to best plot this, so that the connection (or disconnect) between revenue and price is obvious?
Data would look like this:
revenue <- c(23700, 24400, 24000, 23300, 23800, 23600, 23100, 21800, 21600, 20700, 20100)
profit <- c(1426, 1447, 1245, 1599, 896, 813, 706, 510, 649, 789, 947)
quarter <- c("2020_Q1", "2020_Q2", "2020_Q3", "2020_Q4", "2021_Q1", "2021_Q2", "2021_Q3", "2021_Q4", "2022_Q1", "2022_Q2", "2022_Q3")
Any creative ideas on how to solve this?