New to Plotly?
Plotly's R library is free and open source!
Get started by downloading the client and reading the primer.
You can set up Plotly to work in online or offline mode.
We also have a quick-reference cheatsheet (new!) to help you get started!
##  '4.5.2'
Multiple Y Axes
library(plotly) ay <- list( tickfont = list(color = "red"), overlaying = "y", side = "right", title = "second y axis" ) p <- plot_ly() %>% add_lines(x = ~1:3, y = ~10*(1:3), name = "slope of 10") %>% add_lines(x = ~2:4, y = ~1:3, name = "slope of 1", yaxis = "y2") %>% layout( title = "Double Y Axis", yaxis2 = ay, xaxis = list(title="x") ) # Create a shareable link to your chart # Set up API credentials: https://plot.ly/r/getting-started chart_link = api_create(p, filename="axes-mulitple") chart_link