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.8.0'
See also the chapter on subplots in the plotly book
library(plotly) p <- plotly::plot_ly() p <- plotly::add_trace(p, x = c(1, 2, 3), y = c(4, 3, 2), mode='lines') p <- plotly::add_trace(p, x = c(20, 30, 40), y = c(30, 40, 50), xaxis='x2', yaxis='y2', mode='lines') p <- plotly::layout(p, xaxis2 = list(domain = c(0.6, 0.95), anchor='y2'), yaxis2 = list(domain = c(0.6, 0.95), anchor='x2')) # Create a shareable link to your chart # Set up API credentials: https://plot.ly/r/getting-started chart_link = api_create(p, filename="subplots-1") chart_link