The Subplot feature allows you to display multiple plots in a single figure. They can be placed vertically, horizontally, or in a grid.
Add Your Data to Plotly
The first step is to head to Plotly’s new online workspace and add your data. It's also a good idea to name your columns beforehand (either by adding your data using Plotly 1.0, or naming them in the CSV or Excel file that you're uploading), and label your axes. This will make selecting specific traces easier.
Create a Plot
After adding your data go to GRAPH on the left-hand side, then 'Create'. Choose your 'Chart type', and add your traces using the X and Y dropdown (this section is different depending on the chart type).
Select a Subplot
Once you've added your first trace, click the blue '+Trace' button on the right-hand side of the panel to add another. Once that new trace tab opens, click on 'Subplot and Multiple Axes'.
This will open a section where you can select an arrangement for your subplot. As mentioned earlier, you can set them up as stacked or side-by-side.
We want to display four different charts, and we'll start by adding values to our second trace and select the 'Side By Side' arrangement for it, then click CONFIRM. We'll also label the axes right away by clicking and typing directly on them.
Before we move on, it's important to mention the 'Undo' button. If you select an arrangement and you change your mind, 'Undo' will cancel the last arrangement selection only.
Back to adding another trace! We'll repeat the same step as above by hitting the '+Trace' button, adding our traces, then clicking 'Subplot and Multiple Axes'. For our third trace, we'll select the 'Stacked' arrangement.
For our last trace, we'll select the 'Stacked Y-Axis' arrangement. We can select the position by using the 'Current Subplot' dropdown menu. The plot you select from this dropdown will act as the base for the subplot we're adding. Finally, select CONFIRM.
Now each of the four traces has its own plot.
Style a Plot
We've styled this plot quite a bit, which includes removing the axes labels (we don't need them anymore), and adding subtitles for each plot with the annotations feature.
If you like the way we've styled our plot, see this great tutorial.
Save and Share
Your plot is now done! Click SAVE on the left-hand side.
Give your PLOT and DATA a filename and select the privacy setting. For more information on how sharing works, including the difference between private, public, and secret sharing, visit this page.