Show Sidebar Hide Sidebar

How to Make Subplots with a Shared Y-Axis in Plotly 2.0

Create a subplot with a shared y-axis using the Plotly 2.0 data visualization tool

Step 1

Introduction

This feature allows you to plot graphs that share the same y-axis.

Step 2

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.

Import data

Step 3

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. We'll use the bar chart for the first trace.

Subplot Trace

Step 4

Select a Subplot

For the second trace, we'll click the blue '+Trace' button on the right-hand side of the panel, change the chart type to 'Scatter plot', select our x and y values, then click on 'Subplot and Multiple Axes'.

Second trace

This will open a section where you can select an arrangement for your subplot.

Subplot arrangement

We'll select the 'Side by Side X-Axis' arrangement for this trace and select CONFIRM. This will add a subplot to the right of your original plot with a unique x-axis. The y-axis will remain shared. Notice when you zoom in on one subplot, the zoom will be applied vertically to the other subplot as well.

If you select an arrangement and then change your mind, the 'Undo' button will cancel the last arrangement selection only. This is very important to remember.

Undo button

We'll label the x-axis for that last plot by double-clicking the area and typing it directly.

Axis label

Step 5

Style a Plot

We've styled this plot by playing with the colors, and adding grid lines. For more styling tips, consult this page.

Final plot

Step 6

Save and Share

Your plot is now done! Click SAVE on the left-hand side.

Save main

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.

Save pop-up

Still need help?
Contact Us

For guaranteed 24 hour response turnarounds, upgrade to our Premium or Enterprise plans.