Project: Data Visualization with Plotly Express

Welcome to this project-based course on Exploring the Gapminder Dataset with Plotly Express. In this project, you will create quick and interactive data visualizations with Plotly Express: a high-level data visualization library in Python inspired by Seaborn and ggplot2. You will explore the various features of the in-built Gapminder dataset, and produce interactive, publication-quality graphs to augment analysis.

Join for Free
Project: Data Visualization with Plotly Express

Duration (mins)


5.0 / 5


Task List

We will cover the following tasks in 42 minutes:

Loading the Data

In this task, we will first demo Hans Rosling’s visualization of the Gapminder data set. The interactive, animated visualization was shown to the audience of Hans’ Ted talk in 2007. It has gone one to become one of the most watched Ted talks of all time, and is a testament to the power of beautiful and informative data visualizations.

We will then be introduced to the project goals and learning outcomes. Once we are familiarized with the Rhyme interface, we begin working in Jupyter Notebook, a web-based interactive computational environment for creating notebook documents.

Quick Visualizations with Custom Bar Charts

Now that we have imported the data, we are free to use plotly express to explore various facets of this rich data set.

Plotly Express functions take as a first argument a tidy pandas.DataFrame. In this task, we will graph the population of Canada by year using a bar plot. In a bar plot, each row of the DataFrame is represented as a rectangular mark. We will also customize the bar plot using keyword arguments to color the bars according to the average life expectancy.

Plot Life Expectancy vs GDP per Capita

We will create a basic scatter plot showing life expectancy vs GDP per captita by country for 2007.

Next, we will break that down by continent, by coloring the points using the color argument, while px takes care of assigning the default colors, setting up the legend, etc.

Customize Interactive Bubble Charts

Each point in our last plot is a country. So to scale the points by the country population we simply pass in the size argument!

If we’re curious about the identity of a particular point, we can add a hover_name to display the country name. We will never again have to worry about what a particular outlier represents. We can simply mouse over the point we’re interested in and the hover_name will identify it for us!

Create Interactive Animations and Facet Plots

We are able to easily interact with the plots we have created so far. Try mousing over points, clicking or double-clicking on legend items, or using the “modebar” that appears when you move your mouse into the frame to control the behaviour click-drag interactions (zoom, pan, select).

We can also facet our plots to pick apart the continents, just as easily as coloring your points, with facet_col="continent", and let’s make the x-axis logarithmic to see things more clearly while we’re at it.

Maybe we’re interested in more than just 2007 want to see how this chart evolved over time. We can animate it by setting animation_frame="year" (and animation_group="country" to identify which circles match which ones across frames). We can provide prettier labels that get applied throughout the figure, in legends, axis titles and hovers. We can also provide some manual bounds so the animation looks nice throughout.

Represent Geographic Data as Animated Maps

As this is geographic data, we can also represent it as an animated map, which makes it clear that px can make way more than just scatter plots, and that this dataset is missing data for the former Soviet Union.

Watch Preview

Preview the instructions that you will follow along in a hands-on session in your browser.

Snehan Kekre

About the Host (Snehan Kekre)

Snehan Kekre is a Machine Learning and Data Science Instructor at Coursera. He studied Computer Science and Artificial Intelligence at Minerva Schools at KGI, based in San Francisco. His interests include AI safety, EdTech, and instructional design. He recognizes that building a deep, technical understanding of machine learning and AI among students and engineers is necessary in order to grow the AI safety community. This passion drives him to design hands-on, project-based machine learning courses on Rhyme.

Frequently Asked Questions

In Rhyme, all projects are completely hands-on. You don't just passively watch someone else. You use the software directly while following the host's (Snehan Kekre) instructions. Using the software is the only way to achieve mastery. With the "Live Guide" option, you can ask for help and get immediate response.
Nothing! Just join through your web browser. Your host (Snehan Kekre) has already installed all required software and configured all data.
Absolutely! Your host (Snehan Kekre) has provided this session completely free of cost!
You can go to, sign up for free, and follow this visual guide How to use Rhyme to create your own projects. If you have custom needs or company-specific environment, please email us at
Absolutely. We offer Rhyme for workgroups as well larger departments and companies. Universities, academies, and bootcamps can also buy Rhyme for their settings. You can select projects and trainings that are mission critical for you and, as well, author your own that reflect your own needs and tech environments. Please email us at
Rhyme strives to ensure that visual instructions are helpful for reading impairments. The Rhyme interface has features like resolution and zoom that will be helpful for visual impairments. And, we are currently developing a close-caption functionality to help with hearing impairments. Most of the accessibility options of the cloud desktop's operating system or the specific application can also be used in Rhyme. If you have questions related to accessibility, please email us at
We started with windows and linux cloud desktops because they have the most flexibility in teaching any software (desktop or web). However, web applications like Salesforce can run directly through a virtual browser. And, others like Jupyter and RStudio can run on containers and be accessed by virtual browsers. We are currently working on such features where such web applications won't need to run through cloud desktops. But, the rest of the Rhyme learning, authoring, and monitoring interfaces will remain the same.
Please email us at and we'll respond to you within one business day.

Ready to join this 42 minutes session for free?

More Projects by Snehan Kekre