Hi, Karthi
The subplot() function in plotly provides a flexible interface for merging plotly objects into a single object.
1. Create plotly images and store them in variables.
2. provide plotly objects to subplot like below.
Ex:
p1 <- plot_ly(economics, x = ~date, y = ~unemploy) %>% add_lines(name = ~"unemploy")
p2 <- plot_ly(economics, x = ~date, y = ~uempmed) %>% add_lines(name = ~"uempmed")
p <- subplot(p1, p2)
The example is explained in detail here, https://plot.ly/r/subplots/