From the course: Data Visualizations with Plotly

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Creating subplots

Creating subplots - Plotly Tutorial

From the course: Data Visualizations with Plotly

Start my 1-month free trial

Creating subplots

- [Instructor] So far we've focused on outputting a single standalone plot in this course. Now it's time to introduce subplots as a way to include multiple plots in the same output. These plots can be the same plot type and share an axis, or they can even be entirely different plot types arranged in a grid outline. This is a great method to employ when you want to package multiple plots together to tell a more comprehensive story. Subplots themselves are only supported by plotly.graph_objects. So first, we should cover a similar concept in plotly.express, known as facet plots. Before we do, let's import the gapminder data set for the year of 2007 and create a scatter plot. Now let's say we wanted to create a series of plots, one for each continent. To do this, we'll add facet column and set it equal to continent. Hey, that's pretty cool. One plot per continent, all with the shared y-axis. Now, perhaps you want these…

Contents