From the course: Data Visualizations with Plotly

Unlock the full course today

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

Basic charts with Plotly

Basic charts with Plotly - Plotly Tutorial

From the course: Data Visualizations with Plotly

Start my 1-month free trial

Basic charts with Plotly

- [Instructor] In this lesson, we'll review some of the most essential charts Plotly has to offer. To get started, we'll import Plotly dot express as PX then import the Gapminder data set just for Oceana. That is Australia and New Zealand. In our output, you can see this as a time series data set. So let's start off with the line chart, showing life expectancy over time. To create our figure, we call PX dot line and pass in our data frame. We then set the X axis to the year, the Y access to life expectancy, and then we'll color by country calling fig that show, we get our chart. Note we can easily modify the variable that we want to show. For instance, let's look at GDP per capita. And there you have it. With Plotly, it's fairly easy to modify the layout of your chart using the update layout method. Here, we're going to move our legend from its default position to the upper left of our visual. We're setting our legend…

Contents