Data Visualisation with Plotly and Python
4.8 (28 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
372 students enrolled
Wishlisted Wishlist

Please confirm that you want to add Data Visualisation with Plotly and Python to your Wishlist.

Add to Wishlist

Data Visualisation with Plotly and Python

Level up your data visualisation. Learn to create interactive charts and dashboards with Python and Plotly.
4.8 (28 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
372 students enrolled
Created by Richard Muir
Last updated 7/2017
English
Curiosity Sale
Current price: $10 Original price: $150 Discount: 93% off
30-Day Money-Back Guarantee
Includes:
  • 23 hours on-demand video
  • 1 Article
  • 18 Supplemental Resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
What Will I Learn?
  • At the end of this course you'll be able to use Plotly to make interactive line plots, area plots and scatterplots.
  • You'll know how to make stacked and grouped bar charts, pie charts, donut charts and tables.
  • You'll also be able to bring together several different charts into a dashboard.
  • You'll have a working knowledge of the Python programming language, as well as an intermediate knowledge of the Pandas data analysis library.
View Curriculum
Requirements
  • You should have access to a computer onto which you can install software.
  • You should have an interest in data visualisation
Description

Looking to level up your data visualisation skills? Bored of dull, static charts and graphs? This course will teach you to how to use Python to create awesome, interactive data visualisations with the Plotly library. 

What's involved?

You get immediate access to twelve painstakingly crafted and researched chapters, each designed to level up your data visualisation and coding skills. Using my experience as a data visualisation specialist and teacher, I've created original content that uses real-world data to teach you the fundamentals of data visualisation in a clear and easy-to-understand way. 

You'll find this course interesting, fun and engaging. The lessons are paced to build confidence in the skills you're learning, and there are plenty of quizzes and practise activities to solidify your knowledge.


Here's what you get with Data Visualisation with Plotly and Python

  • Access to twelve chapters which take you through each topic, providing plenty of chances to practise.
  • Over 140 Lectures, 27 hours of video content, 40 practise datasets and 11 quizzes
  • Step by step instruction to set up your coding environment and install the required software
  • The course starts with the basics; the first section will give you a basic understanding of the Python coding language. and you'll soon be making some interactive charts!

Over the twelve chapters you'll:

  • Use Plotly to create:
    • Lineplots 
    • Areaplots
    • Scatterplots
    • Bubbleplots
    • Stacked bar charts
    • Grouped bar charts
    • Pie charts
    • Tables
    • Dashboards
  • Bring together everything you've learnt to create three awesome dashboards which showcase your work.
  • Learn how to use colour, interaction and design principles to make your charts really stand out.
  • Build a portfolio of charts that you can use to show off your data visualisation skills.
  • Develop your knowledge of Python and become a confident user of Pandas; the go-to data analysis tool for Python coders.

What else will you get?

  • Personal contact with me - I'll personally answer all of your queries 
  • Lifetime access to the course materials


So what are you waiting for? Level up your data visualisation skills, transform your career and sign up now!




Who is the target audience?
  • The ideal student for this course is a business analyst who uses tools such as Excel to create static charts and graphs, and who wants to improve the quality and accessibility of their outputs.
Students Who Viewed This Course Also Viewed
Curriculum For This Course
143 Lectures
22:52:13
+
Setting up your programming environment
4 Lectures 16:33

In this lesson I'll take you step by step through downloading and installing the Anaconda scientific computing distribution, the Jupyter Notebook software and the Plotly charting library. These are the main software packages that we'll use in the course.

The Anaconda scientific computing distribution contains most of the libraries we'll use in this course. The Jupyter Notebook will allow us to develop our charts and dashboard in an interactive environment, and of course, Plotly is the library we'll be using to actually create the visualisations!

Preview 05:44

In this lecture I'll show you some of the functionality of the Jupyter Notebooks. We'll learn how to open the software, how to create a new notebook, as well as how to add and remove cells.

Introduction to Jupyter Notebooks
05:13

Here you can download all of the materials for the course in one .zip folder. If you prefer to download the materials as you move through the course, you can also download them at the start of each section.

Downloading the course materials
00:03

In this lecture you'll create a Plotly account, and link your installation of Plotly to this account. This will let you publish any charts and dashboards you make straight to the Plotly cloud, where you can share and store them.

Setting up a Plotly account and configuring your Plotly installation
05:33
+
Introduction to Python
21 Lectures 04:09:22

In the downloads for this lecture you can find a zip file which contains all of the Jupyter notebooks, HTML copies of the Jupyter notebooks and all the .csv files used in this section.

The Jupyter Notebooks should serve as an interactive resource for you to code along with or use for review. The HTML copies of these notebooks have all the same information, but lack the ability to actually write code. You might find these helpful for reviewing the lecture materials later.

Download materials for Introduction to Python

In this lesson you'll learn about variables in Python. You'll find out what a valid variable name is. You'll learn how to create variables and assign values to them. You'll learn also learn how to observe the value of a variable.

Learning about variables is a vital part of learning to code, and we'll use them extensively as we create Plotly charts and dashboards.

Variables in Python
08:18

In this lesson you'll learn about how to manipulate numbers in Python. You'll learn about floats and integers as well as how to use different mathematical operators.

We'll have to do different calculations on our data to prepare it before we can display it in a Plotly chart. This lesson will give you the foundation of the knowledge to do this.

Variable Types - Numbers
13:30

In this lecture you'll learn how to create strings in Python. You'll learn how to concatenate and multiply strings, as well as how to convert between integer, float and string variable types.

Strings are used extensively in Plotly charts. We use them for titles and annotations, and sometimes for plotting categorical data.

Variable Types - Strings (1)
15:27

In this lesson you'll learn how to index and slice strings (how to select specific characters in a string by their position). You'll also learn about some common and useful functions and methods which can be applied to strings.

Learning how to manipulate strings in this way will give you much more flexibility when creating charts and dashboards with Plotly.

Variable Types - Strings (2)
17:31

In this lesson you'll find out about Boolean, or True/False variables. You'll also learn how to make logical comparisons between variables. 

We'll use variable comparisons throughout this course and they are an essential ingredient for creating charts and dashboards using loops and conditional programming.

Variable Types - Boolean
16:40

We'll now look at complex data types. The first of these is the list. In this lesson you'll learn what a list is, how to do mathematical operations on a list and how to index and slice them to select particular values.

Understanding how to manipulate lists is key to being able to create charts and dashboards using Plotly. For example, the x- and y-values for a Plotly chart are always stored in a list.


Variable Types - Lists (1)
12:57

In this lecture you'll learn how to add to and delete items from a list. You'll also learn about nested lists and how to access the data within them.

Adding and deleting items from a list is a skill which we'll use very often as we create more complex charts, as is accessing items in a nested list; Plotly uses a nested data structure to hold the information about charts.

Variable Types - Lists (2)
14:13

The second type of complex variable which we'll use in this course is called a dictionary. Plotly expects to receive a dictionary of instructions which it will use to create the chart. It's therefore really important to understand dictionaries well.

In this lesson you'll learn how to create a dictionary and access items within it. You'll also learn how to add items to, and delete items from a dictionary.

Variable Types - Dictionaries (1)
13:35

In this lesson you'll learn how to implement some useful methods and functions on a dictionary. You'll learn how to get the dictionary's keys and values, as well as how to create and access nested dictionaries.

Plotly stores the instructions for a chart in a nested dictionary. Knowing how to interrogate and manipulate a nested dictionary is therefore vital for creating charts and dashboards with Plotly.

Variable Types - Dictionaries (2)
10:43

In this lecture you'll learn how to implement If-Else statements to make decisions in your code. You'll learn why conditional programming is so powerful and how we can use it to help us create beautiful charts with Plotly.

If-Else Statements
09:57

For loops are really useful; with them we can write powerful code which plots many different data items.

In this lecture you'll learn how to create a For loop which will let you run the same piece of code a number of times. You'll learn how to write a loop which runs through a specified range of values.

We'll use For loops extensively to create Plotly charts and dashboards with many data items.


For Loops (1) - Looping through a range of values
13:20

In this lecture you'll learn how to write a For loop which operates on each item in a sequence. This is a very flexible way of writing code.

Using such a loop to create a Plotly chart will allow you to reuse one piece of code to create a chart from a changing data source.

For Loops (2) - Looping through the items in a sequence
12:15

In this lecture you'll learn how to run two For loops at the same time. This will allow you to plot a large amount of data with only minimal code.

Using a nested for loop will allow you to plot many different data items on a Plotly chart.

For Loops (3) - Nested Loops
13:21

Being able to write your own functions will allow you to really explore the heights of your imagination when creating charts. They are a flexible and powerful way of writing code and we will use them often in this course.

In this lecture you'll learn how to use the 'def' keyword to define your own functions. You'll learn how to pass arguments to functions and how to return objects from a function.

Throughout this course, we'll create functions to help us make many different charts in Plotly. We'll also write some functions which we will be able to reuse to create a complete chart.


Functions (1) - Creating Functions
10:45

In this lecture you'll practice writing functions. We'll also create an example function which you can use later in the course to set the colour of a data item in a chart or dashboard.

Functions (2) - Using Functions
11:37

Being able to import and utilise different code libraries that other people have written is perhaps the single most powerful thing we can learn in Python. It gives us access to code written by some very experienced programmers

In this lecture you'll learn how to import different code libraries and specific functions from those libraries. 

You'll also learn which modules we'll be using most throughout the course, and how we'll import them.

Plotly itself as a Python library which we will import, and we'll use various functions from this library to create interactive charts and dashboards.

Importing Modules
08:56

Pandas is a powerful data analysis library which we'll use in almost every lesson in this course. It stores data in a tabular form, in an object called a DataFrame.

In this lecture you'll learn how to create a DataFrame from a .csv file. We'll use .csv files throughout this course - all of the data that we'll use to create Plotly charts and dashboards is stored in .csv files.

Preview 08:31

In this lecture you'll learn some helpful DataFrame functions which will make your life a lot easier!

Being able to easily manipulate data will really help you to create effective Plotly charts.

Preview 05:52

In this lecture you'll learn how to access the data in a DataFrame column, as well as how to create columns directly and from a list.

Plotly interacts very well with Pandas - we can pass a column of data from a Pandas DataFrame directly to Plotly with no problems. You'll use the information in this lesson for almost every chart or dashboard that you create.

Preview 09:42

In this lecture you'll learn how to make changes to the DataFrame itself; how to drop and rename columns, as well as how to set the index.

Manipulating the DataFrame in this way allows you to be selective about which data you store and plot. You'll therefore be able to make Plotly charts and dashboards much more quickly.

Preview 08:00

In this lecture you'll learn how to use positional and label-based selection to select and change specific observations in a DataFrame.

Data isn't always clean and easy to use. Using the information in this lesson you'll be able to clean up the data and make much clearer charts.

Preview 14:12

Here's your chance to practise what you've learnt so far about variables in Python. Doing this quiz will help to solidify your knowledge and better prepare you for the lessons ahead.

Variables Types in Python
8 questions

Here's your chance to practise what you've learn about if-else statements, for loops and functions.

Practising what you've learnt will help to solidify your knowledge and better prepare you for the lessons ahead.

Conditional programming in Python
5 questions

The questions in this quiz will give you a great opportunity to solidify your knowledge of the Pandas data analysis library. Having a basic understanding of this library will allow you to get the most from this course.

Working with the Pandas library
5 questions

During this section you've learnt enough Python to be able to get the most from this course, and you'll have also learnt much more by the end!

However, if you're really keen to improve your skills here, there is a wealth of information available for the keen Python student. In the notes here I've listed some resources that I found really helpful when I was starting out. I hope these help you. Likewise, if you come across other resources or even other Udemy courses which teach Python, it would be great to see a link to them in the comments!


Further resources for learning Python
+
Lineplots and Area Plots
15 Lectures 03:13:09

In the downloads for this lecture you can find a zip file which contains all of the Jupyter notebooks, HTML copies of the Jupyter notebooks and all the .csv files used in this section.

The Jupyter Notebooks should serve as an interactive resource for you to code along with or use for review. The HTML copies of these notebooks have all the same information, but lack the ability to actually write code. You might find these helpful for reviewing the lecture materials later.

Download materials for Lineplots

In this lesson we'll find out how to make a simple linechart in Plotly. We're going to start at the very basics, but as we progress through the lessons in this section, we'll add more options to our code and more functionality to our chart.

First of all we'll learn about the concept of a 'trace'. We'll make a chart with one trace and in doing so learn how to set the values of the x- and y-variables.

Introduction to Lineplots in Plotly
15:58

In this lesson we're going to use the dict.update() method to plot different data in our chart. This is useful because it allows us to reuse and update any charts made with Plotly.

Plotting different data
07:15

In this lesson we're going to plot data from a Pandas DataFrame which we've created from a .csv file.

We'll use the concepts in this lesson in almost every subsequent lesson in this course. Plotly interacts very well with Pandas and we will plot many different Plotly charts from many different Pandas DataFrames.

Plotting data from a Pandas DataFrame
09:16

In this class you'll learn how to plot multiple lines on the same chart. Each line which we will plot on the chart represents a different column in the DataFrame, and by plotting multiple lines on the same chart, we can compare the values of the data in different columns.

We will create many different Plotly charts which allow us to compare different data items; this is just the beginning!

Plotting multiple lines
08:55

In this lesson you'll learn how to add any number of traces programmatically using a For loop. You'll learn two different methods of doing this; the first will allow you to create a set number of traces, whilst the second will allow you to create a chart with a dynamic number of traces. This is an essential skill to learn as you create charts which may need updating in the future.

We'll use the concepts introduced in this lesson to make Plotly charts throughout this course. Using a For loop to create multiple traces is a really efficient way of creating complex data visualisations.

Plotting multiple lines with a For loop
12:49

In this lesson we'll learn how to change the colour and thickness of the line.

Understanding how colour and shape affect people's perception of the relationships between different data is vital to creating effective charts and I urge you to go beyond the concepts introduced in these lessons.

There are many great articles available to help us understand how people perceive colour. Maureen Stone speaks about how to use colour to group and distinguish different data elements in a chart, Samantha Zhang has a more practical article on how to actually choose the colours for your visualisation, and Lisa Charlotte Rost provides information on many different resources which you can use to help you incorporate colour into your data visualisations.

These resources are really helpful, but you will learn the most by experimenting with your own charts and by casting a critical eye over your own and others' charts.

Changing line colour and thickness
14:40

In this lesson we'll learn how to displayed a dashed or dotted line instead of a solid line. In the next lesson we'll find out how to set the marker symbol for each trace. With these two options, Plotly gives us a great deal of freedom to style our charts and dashboards.

Making dashed and dotted lines
11:48

In this lesson you'll learn about the different marker symbols that you can use in a Plotly chart. You'll learn how to set the chart to show marker symbols and how to change the size, colour and shape of the marker symbols.

We can use marker symbols to great effect on a line chart; they really help the reader to understand where the data points are on the chart.

Adding and changing marker symbols
16:17

In this lesson I'm going to show you how we can change how the line in a lineplot is displayed. We'll investigate how to use Plotly's built in smoothingoption to allow us to smooth out some of the fluctuation in the line.

Before you apply smoothing to a line chart, you should consider very carefully why you are doing it, and what information you may lose by doing so. Essentially, when you smooth a line plot you are plotting data that doesn't exactly exist. For example, when you have a few points on a plot, a smoothed line will follow a different path to a straight line connecting these points.

Applying smoothing (1)
06:27

Note that Yahoo Finance has removed their API. You should instead use the Google Finance API:

    data.get_data_google('AAPL', '1/1/2012', '1/1/2013')

In this lesson we'll learn how to apply a Savitzky-Golay smoothing function to our data. The Savitzky-Golay function is available as part of the SciPy library which we installed as part of the Anaconda distribution and is a much more powerful smoothing function than that available in the Plotly library. 

We'll create a Plotly chart and  apply this smoothing function to stock market data which we'll download directly from the Yahoo Finance API using Pandas. It is common to apply smoothing to stock market data; the daily fluctuations can obscure more tangible, long-term movement in the stock price. By applying smoothing to our chart we will be able to see this movement more clearly.


Preview 13:38

In this lesson we'll learn about stepwise line shapes and in which circumstances we can use them. We'll apply stepwise line shapes to data on the Bank of England base rate.

Stepwise lines are fairly uncommon in data visualisation, especially when compared with a normal line chart. Plotly offers several different options for applying a stepwise line shape to the line plot, and some of these are more useful than others.

Stepwise line shapes
11:22

In this lesson I'm going to introduce the 'fill' option and how we can use it to create an area plot. An area plot is basically a line plot with the colour filled in between the trace and the axis.

Although an area plot shows the same information as a line plot, the way the data is presented means that they are particularly suited to presenting a quantity of data, such as the amount of oil, money or pollution. The fact that the chart is filled in with colour really helps the reader understand that we are representing a quantity, rather than just a number.

Plotly has many options which allow us to create different kinds of area plots, and we'll explore these options more fully in the next few lessons. 
Creating an area plot
18:28

In this lesson we'll find out how to create a stacked area plot. A stacked area plot is similar to a multiple line plot, however the spaces between each trace are filled with colour. This kind of plot is used to show the change in cumulative quantities. In this lesson we make a stacked area plot to show the total cumulative C02 emissions for five countries.

We'll also learn how to prepare our data to allow it to be presented as a stacked area plot - Plotly expects the data for this type of chart to be in a specific format to prevent the chart from being misleading, or simply wrong.


Creating a stacked area plot
16:37

In this lesson we'll learn how to create stacked proportional area plots with Plotly. Whereas a stacked area plot shows the change in quantity of something, a stacked proportional area plot shows how the quantity changes relative to the whole. We'll reuse the C02 emissions data in this lesson, presenting the same data as a stacked proportional area plot, rather than a stacked area plot to show the different messages that can be displayed depending on the choice of plot.

The code we'll use for the chart will be almost identical to that which we wrote in the previous lesson; the novelty in this lesson will be learning how to do a little data manipulation to get the data into percentages of total emissions, rather than just the raw figures.

We'll also prepare the data in a way that allows us to create the traces using a loop, rather than the long-form way we learnt in the previous lesson, and in doing so we'll learn how to use the pandas.cumsum() function to get a cumulative sum over several columns.


Creating a stacked proportional area plot
16:13

In this lesson, we take the code that we wrote to create a stacked proportional area plot with Plotly, and generalise it to allow us to create a similar plot from other data sources.

This will be the most difficult piece of code we'll have written on this course. We'll write that function that uses Plotly and Pandas together to create this chart.

Writing a function to create a stacked proportional area plot
13:26

The information in this quiz will help you to review what you've learnt so far about how to make lineplots and area plots. I recommend doing this quiz before having a look at the practise datasets.

Review of lineplots and areaplots
5 questions

Here's a few datasets for you to practise what you've learnt in this section. I would love to see what you produce with these! 

Post a link to your charts in the comments :-)

Practise datasets for lineplots and area plots
+
Styling your charts
9 Lectures 02:08:42

In the downloads for this lecture you can find a zip file which contains all of the Jupyter notebooks, HTML copies of the Jupyter notebooks and all the .csv files used in this section.

The Jupyter Notebooks should serve as an interactive resource for you to code along with or use for review. The HTML copies of these notebooks have all the same information, but lack the ability to actually write code. You might find these helpful for reviewing the lecture materials later.

Download materials for section Styling your charts

In this lesson we're going to learn how to load a chart from the Plotly cloud, update the range of the axes for the chart, and send the updated chart back to the Plotly cloud.

We'll use the DataFrame.min() and DataFrame.max() functions to calculate what the range of the axes should be, and we'll also investigate how setting the range to 0, or to the minimum value of the data can affect the user's perception of the chart.

Changing the range
14:22

In this lesson we'll learn how to set currency and percentage formats on the axis tick labels of our chart. Plotly allows for very fine control when styling the axes, and this lesson provides an introduction to the range of options available. 

Setting informative ticklabels is essential for creating charts that are clear and easy to understand.

Setting the tick format
19:31

In this lesson we'll learn how to modify the standard tickvalues by adding a tick prefix or suffix to each of them. We'll also learn how to specify the number of ticks that Plotly shows on the axis of the chart.

Modifying the tick labels
14:17

In this lesson you'll learn how to create custom ticklabels and set their position using the 'tickmode''tickvals' and 'ticktext' parameters. We'll also learn how position these labels exactly on the axis. 

Setting the ticklabels in this way let us have complete control over how the axes on our charts are labelled. The defaults which Plotly uses are more than sufficient for most needs, but by changing the ticklabels in this way, our options become almost limitless.

Creating and positioning custom tick values
09:17

In this lesson we'll find out how to set the hovertext and control what is displayed when a user hovers over a point on the chart.

Hovertext is one of the best features about Plotly; it's this functionality which sets it apart from static charts. Without hovertext, a user who noticed an interesting data point would have to consult a table to find the values of that data point, or read through the description of the chart to see if there is an explanation for it. With hovertext, you can provide this information directly to the user when they hover their mouse pointer over a particular data point. 

Creating hoverinfo which is clear and intuitive is therefore really important when creating charts with Plotly, and this lesson will set the groundwork for later in the course.

Controlling hovertext on your chart
12:58

***Note that the numbers are rounded incorrectly in this lesson. Rather than using x.round(0) , you should instead use  round(x, 0).***

In this lesson we'll learn how to create a custom text field in a Pandas DataFrame using the and lambda functions. 

Because Plotly is built upon web technologies, it understand some HTML tags which we can use to style the hovertext field. We'll learn some of the tags we can use in this way.

Setting custom hovertext gives you very fine control over how the contextual information in your chart is displayed. Doing this correctly will really make your charts stand out.

This lesson has a strong focus on manipulating data in a Pandas DataFrame. We'll learn several different data manipulation techniques, but if you get stuck or don't understand something, please ask in the comments section.

Creating custom hovertext
18:40

***Note that the numbers are rounded incorrectly in this lesson. Rather than using x.round(0) , you should instead use  round(x, 0).***

In this lesson we'll take the custom hovertext which we previously created, and apply it to a Plotly chart that we previously created. We'll also learn to control how the hovertext is triggered when a user moves their mouse near a data point.

Applying custom hovertext
12:11

***Note that the numbers are rounded incorrectly in this lesson. Rather than using x.round(0) , you should instead use  round(x, 0).***

In this lesson we'll apply what we've learnt about ranges, ticklabels and hovertext in this section to the stacked quantity C02 emissions area plot, updating it with this improved functionality.

Practise (1)
16:04

This is your second opportunity to practice what you've learnt about styling your charts. In this lesson you'll apply what you've learnt to the function which creates stacked proportional area plots.

Practise (2)
11:22

Here's your chance to review things that you've learnt in this section. I recommend completing this quiz before moving on to the next lecture where you will practise what you've learnt.

Styling your charts - review
6 questions

Here's your chance to further practise what you learnt in this section. Remember those charts you made at the end of the last lesson? Now's a great time to go back to them and apply what you've learnt here. 

Hovertext makes Plotly charts stand apart from the static chart libraries; you could add hovertext to any charts you've produced. 

By applying this knowledge to charts that you've produced yourself, you'll solidify this knowledge and feel really confident applying it in future.

Practising your chart presentation skills
+
Scatterplots
14 Lectures 03:21:22

In the downloads for this lecture you can find a zip file which contains all of the Jupyter notebooks, HTML copies of the Jupyter notebooks and all the .csv files used in this section.

The Jupyter Notebooks should serve as an interactive resource for you to code along with or use for review. The HTML copies of these notebooks have all the same information, but lack the ability to actually write code. You might find these helpful for reviewing the lecture materials later.

Download materials for Scatterplots

Scatterplots are used to show the relationship between two variables. The relationship can be positive or negative, and strong or weak. In this lesson you'll learn how we plot data on a scatterplot, how we interpret the direction and strength of a relationship on a scatterplot and how we can quantify the relationship between two variables by using a regression line.

Scatterplots 1 - What is a scatterplot?
05:33

In this lesson we're going to make our first scatterplot showing the relationship between revenue and number of employees for around 50 different companies.

With Plotly, we make scatterplots and lineplots in very similar ways, so the next few lessons should not only teach you about scatterplots, but also serve as a handy revision guide for the Lineplots section.

Scatterplots 2 - Making our first scatterplot
09:50

In this lesson we're going to learn how to apply different styling options to the marker points. We've already briefly touched upon this in the lineplots section, however in this lesson we'll take a more in-depth look at the styling options available in the Plotly library.

In the lineplots section, the aim of utilising the marker styling options was to enable us to distinguish between the different data points, however this lesson will focus more on the stylistic aspect of manipulating the marker symbols - let's make them look GOOD!

We'll quickly review the available marker symbol shapes, then find out how to change their size, opacity, colour and outline.

Scatterplots 3 - Styling the marker points
08:07

In this lesson we're going to plot the famous Iris flower dataset which is often used as a test case for machine learning models. This dataset contains 50 samples from each of 3 species of the Iris flower (setosa, virginica and versicolor), and each flower had four measurements taken from it; the length and the width of the sepals and the petals.

We're going to create a Plotly scatterplot from this dataset, and in doing so apply the marker styling options that we learnt in the previous lesson.

We're also going to find out how to use Pandas to get a dataset straight from table in a webpage - this is a really useful tool which will allow you access many different data sources.

Scatterplots 4 - Plotting different categories on the same plot
17:39

In this lesson you'll learn how to link different traces together using the Plotly legendgroup option. This will allow you to show and hide different traces at the same time and give your users different options for how to interact with your chart.

We're going to plot data on life expectancy at age 60 against the dollar price of the most popular brand of cigarettes. The dataset contains data for 182 countries, each belonging to one of six regions. Each country has an observation on the life expectancy for males and females.

This will be quite a complex chart, but by utilising the different plotting options available in the Plotly library we should be able to make this chart look great.

Scatterplots 5 - Controlling traces and legend items
18:56

In this lesson you'll learn how to train a linear regression using the SciPy library. In the next lesson you'll learn how to plot this line on a scatterplot. Using statistical concepts in your charts will help you to communicate your findings to different audiences.

When we've fitted a regression to our data, we'll plot the line on our chart and add an annotation to show the formula for the line. Plotly allows you to add many different objects to your chart, and annotations are one of the most useful.

Scatterplots 6 - Fitting a regression line
14:51

In this lesson we're going to fit and display a regression line and equation to the data for males and females separately. This is a great opportunity to practise this skill, and it also results in a very striking chart.

Using Plotly, we have loads of options for styling annotations and we'll use some of them to change the colour of the text so that each can be attributed to the correct data source.

Scatterplots 7 - Plotting and styling regression lines
18:22

Plotly has several different options for adding text to a chart. We have already seen how to add text annotations to a chart in the previous lesson, and in the previous section we saw how to add hovertext. In this lesson we'll look at how to repurpose the 'text' option in the trace to add text notes to certain points on the chart.

Adding these notes are a really helpful way of explaining outliers to your readers, especially if you expect that your charts will mainly be viewed in a static medium such as print. In these circumstances creating the hoverlabels will not be sufficient to explain the data.

Scatterplots 8 - Adding text to charts
19:30

Bubbleplots are a special kind of scatterplot. They are used to show information about three variables; the third variable is shown by the size of the bubble. You can even encode a fourth variable in the colour of the bubble.

In this lesson we'll learn how to change the size of our scatterplot markers and thus create a bubbleplot. Plotly makes it very easy to create bubbleplots, and there are several different options which we will explore here.

Scatterplots 9 - Making bubbleplots
15:27

In this lesson we're going to recreate Hans Rosling's famous Gapminder bubbleplot.

We'll practise how to use Plotly's 'marker' : {'size' : } and 'sizeref' options to change the size of the bubbles and we'll also learn how to set the 'sizemin' property to set the minimum size of the bubbles on the plot to help us account for the large difference in sizes between the countries; the smallest country has just 104,000 people, whilst the largest has 1.3 billion.

Preview 17:35

Plotly's sub-plots allow us to plot several different charts on the same figure. Over the next few lessons we'll learn how to utilise this feature to create a scatterplot matrix showing the relationships between several different variables.

We will use the Plotly sub-plots feature throughout this course and it is vital for creating interesting dashboards with Plotly.

Scatterplots 11 - Plotting multiple plots together
09:38

In this lesson we'll take the empty scatterplot matrix that we made with the Plotly subplots function, and add some data to it. We'll go back to using the Iris Flower dataset to do this.

Scatterplots 12 - Making a scatterplot matrix
13:59

In this lesson we'll spend some time making our scatterplot matrix look great!

We're going to learn how to change the dimensions of the chart, set subplot titles and manipulate each of the x- and y-axes of the subplots object. This will allow us to make sure that any mulitple plots that we create using the Plotly subplots function are clear and well-presented.




Scatterplots 13 - Styling our scatterplot matrix
14:23

In this lesson we'll take the code that we wrote in the previous few lessons, and generalise it into a function that will allow us to create a Plotly scatterplot matrix from any data source.

This will greatly increase the speed at which we can create charts, making it quicker and easier to gain insight from data.


Scatterplots 14 - Writing a function for a scatterplot matrix
17:32

Here's a dataset with a few different variables for you to practise what you've learnt in this section. I would love to see what you produce with it! 

You could try making a scatterplot matrix, a bubbleplot, or even try calculating a linear regression!

Post a link to your charts in the comments :-)


Practise datasets for scatterplots and bubbleplots

Here's your chance to review some of the things you've learnt about how to make scatterplots with Plotly. I recommend completing this quiz before moving on to the practise datsets.

Scatterplots - Review
5 questions
+
Styling your charts (2)
8 Lectures 50:18

In the downloads for this lecture you can find a zip file which contains all of the Jupyter notebooks, HTML copies of the Jupyter notebooks and all the .csv files used in this section.

The Jupyter Notebooks should serve as an interactive resource for you to code along with or use for review. The HTML copies of these notebooks have all the same information, but lack the ability to actually write code. You might find these helpful for reviewing the lecture materials later.

Download materials for Styling your Charts 2

In this lesson we'll learn about the different options for styling text in Plotly.

We'll specifically look at how to style the global font, and how implementing a particular style will affect all the other text elements on the chart.

Styling the global font
05:26

In this lesson we're going to learn more about how to apply styling options to text displayed in Plotly.

We can apply different styling options to annotations, text, ticklabels and titles to make them stand out from the rest of the chart. 

Styling annotations, text, ticklabels and titles
06:38

Plotly allow us to position annotations with a great degree of accuracy. In this lesson we'll learn how to position the annotation text on the chart with greater precision by using the 'textangle''xanchor' and 'yanchor' options.

Further styling of annotations
05:33

Plotly also allows us to position annotations outside of the plotting area. This means that we can place text outside of the plotting area which gives us more flexibility when describing elements of our charts.

We'll learn how to set the position of annotations using normalised coordinates which correspond to the area which contains the chart (the 'paper') rather than by using the coordinates of a data point on the chart.

This allows us to consistently position annotations in a specific area of the chart without having to make any reference to the data.

This is especially useful when making a chart that will be updated with different data - you may want an annotation at a specific point on the chart, but when making reference to the data, this specific point will move. Using normalised coordinates prevents this from happening.


Positioning annotations outside of the chart
05:22

Changing the margins on our chart allows us to make room for long ticklabels, extra annotations, or just to create some space between the chart and any other content. In this lesson you'll learn how to change the top, bottom, left and right margins.

Changing the margins
04:41

In this lesson we'll combine what we've learnt in the previous few lessons to create a source annotation for our charts. This is a really important addition as it means that people can easily find the data you used to create your chart, and replicate it or explore it further.

Adding a source annotation
07:43

We'll now move away from annotations for a couple of lessons and instead learn some different ways we can control the Plotly sub-plots figure.

In this lesson we'll see how to change the horizontal and vertical spacing between the different charts within the subplots object.

Different subplots options
05:39

In this lesson you'll learn how to combine spaces on a subplots object. Plotly gives us very fine control over how the cells in a dashboard are arranged. This allows us to make dashboards with more interesting layouts. We'll use the layout that we create in this lesson at the end of the next section to create our first dashboard.

Combining subplots grid spaces
09:16

This is your chance to review what you've learnt in this section before applying your knowledge in the final lecture.

Styling your charts - review
5 questions

Here's your chance to further practise what you learnt in this section. Remember those charts you made at the end of the last lesson? Now's a great time to go back to them and apply what you've learnt here. 

You could add a source annotation to each of your charts, or perhaps a different annotation explaining an unusual data point. Maybe you want to create a new subplots grid template for an idea you have for a dashboard?

By applying this knowledge to charts that you've produced yourself, you'll solidify this knowledge and feel really confident applying it in future.

Practising your chart presentation skills
+
Bar Charts
9 Lectures 01:01:20

In the downloads for this lecture you can find a zip file which contains all of the Jupyter notebooks, HTML copies of the Jupyter notebooks and all the .csv files used in this and the following section.

The Jupyter Notebooks should serve as an interactive resource for you to code along with or use for review. The HTML copies of these notebooks have all the same information, but lack the ability to actually write code. You might find these helpful for reviewing the lecture materials later.


Download materials for Bar Charts section

In this section we're going to learn how to create barcharts with Plotly. A barchart is used to display categorical data, with the size of the bar representing the quantity (or sometimes proportion) in that particular category. Barcharts make it easy to compare different categories because we can easily assess which bars are longer than others.

What is a bar chart?
03:01

In this lesson we're going to make our first Plotly barchart. We're going to make a really simple barchart which we will then use to learn about the different styling options available to us.

For the majority of this section we're going to focus on a single dataset; the NASA Meteorite Landings dataset. This is a very rich dataset which will allow us to make some diverse and interesting bar charts.

Making our first bar chart
07:10

Plotly gives us as many styling options for a bar chart as for lineplots and scatterplots. In this lesson we'll learn how to style the bars on our bar chart. We'll change the colour, opacity and outline of the bars.

Styling options for a bar chart
04:53

In this lesson we'll learn how to change the colour of individual bars in a barchart. This will allow us to highlight individual data points to our user and aid understanding of the charts we make. 

Styling individual bars
07:50

In this lesson we'll learn how to change our vertical bar chart to a horizontal bar chart. This will give us greater flexibility when designing clear and concise charts. Plotly makes it really easy to change the orientation of a barchart from vertical to horizontal.

Horizontal bar charts are very useful when we have categories with long label names; the names often overlap when a vertical bar chart is used.

Horizontal barcharts
04:14

In this lesson we're going to make a slightly more complex barchart which shows multiple categories. This allows us to compare different variables on the same chart and make stacked or grouped bar charts.

We're going to plot the number of meteorites by continent since the year 2000, and by doing so we'll get some experience of how Plotly creates a bar chart with multiple traces.


Plotting multiple bar traces
08:12

In this lesson we're going to learn how to use the Plotly 'barmode' option in the layout to switch between stacked and grouped bar charts.

Using stacked and grouped bar charts allows us to compare the same data in different ways. Grouped bar charts allow us to compare quantities between different sub-categories, whilst stacked bar charts allow us to make comparisons between the sub-categories as part of the whole category. 

Creating stacked bar charts
06:22

In this lesson we'll find out how to create a stacked proportional bar chart.  Using this type of chart to compare data within categories is helpful when we have one or two categories with large values that make it harder to read the smaller values.

To make a stacked proportional bar chart in Plotly we must first do some data processing. This is similar in concept to the stacked area chart that we learnt how to make in the Lineplots section.

Preview 12:27

In this lesson you'll learn how to plot two different types of trace on the same chart by plotting a line trace and a bar trace together. Creating charts like this gives us more flexibility in how we compare different variables and Plotly makes it very easy to combine these two types of trace.

Plotting bar and line plots together
07:11

This is your chance to review some of the things you've learnt about bar charts before you use the practise datasets to make your own charts.

Barcharts - review
5 questions

Here's a few datasets for you to practise what you've learnt in this section. I would love to see what you produce with these! 

Post a link to your charts in the comments :-)

Practise datasets for bar charts
+
Making our first dashboard
3 Lectures 32:50

In the next three lessons we're going to create our first dashboard. We're going to take the Plotly subplots template object that we created at the end of the last section and populate it with three different charts.

We're going to include the stacked proportional barchart that shows the number of meteorites by continent as well as two new charts. The first will display a time series line chart of the number of meteorites found in different weight categories each year, and the second will be a scatterplot showing the different weights of the different types of meteorite.

In this lesson we'll initialise our Plotly subplots object and insert the first chart.

Creating our first dashboard (1)
09:26

In this lesson we'll insert the second two charts into our dashboard template. These charts will show information about the weights of the meteorites which fell.

Creating out first dashboard (2)
09:19

Here, we'll apply some different styling options to our dashboard to give it a consistent theme and make it look great!

The styling options we apply to this dashboard are not all unique to the Plotly subplots figure; most of the styling options we'll be applying will concentrate on making the individual plots look cohesive. 

Styling our first dashboard
14:05
+
Styling your charts (3)
5 Lectures 24:52

In the downloads for this lecture you can find a zip file which contains all of the Jupyter notebooks, HTML copies of the Jupyter notebooks and all the .csv files used in this section.

The Jupyter Notebooks should serve as an interactive resource for you to code along with or use for review. The HTML copies of these notebooks have all the same information, but lack the ability to actually write code. You might find these helpful for reviewing the lecture materials later.

Download materials for Styling your Charts 3

Plotly gives us many different options for styling the legend. In this lesson we're going to learn how to apply some styling options to the legend. We're going to see how to set a border for the legend and find out how to change the thickness and color of the border. We'll also look at how the set a background colour for the legend.

Styling the legend
04:02

In this lesson we're going to look at different ways of displaying the traces in the legend. In the final lesson of the previous section we saw how to set a legendgroup for our traces, and that we can increase the space between the different legend groups. In this lesson we're going to look at different values for the tracegroupgap, and we're also going to find out how to change the order of the traces in the legend by changing the traceorder parameter.

Changing the position of traces in the legend
06:46

In this lesson we'll learn how to move the legend anywhere on our plotting area. Plotly lets us position the legend in the same way that we position annotations - that is, using normalised coordinated. This will give us loads of flexibility when designing our charts, especially when we have to fit them to a specified width or height.

Positioning the legend
04:40

Here we'll find out how to create horizontally-aligned legends. Horizontal legends fit very neatly above or below a chart and are especially useful when you have a limited width for your chart, or your trace names are especially long. Plotly makes it very easy to create a horizontally-aligned legend, but it's definitely worth taking the time to position it carefully.

Horizontal legends
06:45

In this lesson we'll find out how to set the colour of the chart and the chart background. This is especially useful for if you need to align the presentation of your charts with a specific theme or brand.

Changing the background colour of a chart
02:39

Here's your chance to review what you've learnt in this section before you apply it in the next lecture.

Styling your charts - review
5 questions

Here's your chance to further practise what you learnt in this section. Remember those charts you made at the end of the last lesson? Now's a great time to go back to them and apply what you've learnt here. 

Try moving and styling the legend in the charts you made at the end of the bar chart section? Maybe you could invent a whole new plot style with a different background colour as a starting point?

By applying this knowledge to charts that you've produced yourself, you'll solidify this knowledge and feel really confident applying it in future.

Practise your chart presentation skills
+
Pie charts
9 Lectures 01:40:03

In the downloads for this lecture you can find a zip file which contains all of the Jupyter notebooks, HTML copies of the Jupyter notebooks and all the .csv files used in this section.

The Jupyter Notebooks should serve as an interactive resource for you to code along with or use for review. The HTML copies of these notebooks have all the same information, but lack the ability to actually write code. You might find these helpful for reviewing the lecture materials later.

Download materials for Pie Charts

In this lesson we're going to learn about pie charts. We'll find out what kind of data they are used to represent and in what situations they should be used. We'll also learn about some of the things we should and shouldn't do when making pie charts.

What is a pie chart?
04:42

In this lesson we'll make our first pie chart to display categorical data, and in doing so, learn how a Plotly pie chart trace differs fundamentally from a bar or scatter trace.

We'll also learn how to use the 'sort' and 'direction' parameters to change the order in which the segments are placed.

Making our first pie chart
08:19

In this lesson we'll learn about some of the different styling options for pie charts that are available in the Plotly library. We'll see how to set the colours for the segments, as well as how to add an outline. This will allow us make really good-looking pie charts!

Styling a pie chart
06:11

Bringing our readers' attention to a specific segment in a pie chart is very useful when we want to tell a story with our data and Plotly allows us to do this very easily indeed. In this lesson you'll learn how to pull out different segments in a pie chart in order to highlight them to your reader.

Highlighting specific segments of a pie chart
13:52

Labels, text and hoverinfo work slightly differently on a Plotly pie chart. In this lesson we'll learn about these differences and how to use the new options that we have available to us. With this knowledge, we can make sure our pie charts are really clear and informative.

Labels, text and hoverinfo
10:51

Plotly allows you to position text inside and outside of the pie chart segments. In this lesson we'll learn how to set different styling options for text at each location. This means that no matter the colour scheme of the pie chart or the background of the chart, our segment labels will be clear and descriptive.

Text inside and outside the segments
07:03

Pie charts and subplots objects interact differently in Plotly because, unlike a standard bar or line chart, Pie charts have no concept of an x- or y-axis. Plotly therefore does not understand how to map the range of the data in a pie chart, to the domain which it occupies on the dashboard. We therefore have to specify this domain ourselves.

In this lesson we're going to learn how to position pie charts in a Plotly subplots object. This will allow us to include pie charts in any dashboard we make; an important goal!

Using pie charts in a subplots object
17:35

When we include multiple pie charts on the same figure, we can size these charts relative to each other. This tell our readers not only the proportion that each category takes in each pie chart, but also the relative amounts represented by each pie chart.

In this lesson we're going to practise placing pie charts in a Plotly subplot. We're also going to employ the 'scalegroup' parameter to size these linked pie charts by their totals, relative to each other.

Sizing pie charts relative to each other
19:06

Donut charts are a special type of pie chart. They allow us to conceptually link data and a description of the data by putting text in the hole of the donut. In this lesson we'll see how to create a donut chart using Plotly as well as how to position an annotation within the hole.

Preview 12:24

Here's your chance to review what you've learnt about pie charts before you use the practise datasets.

Pie charts - review
6 questions

Here's a few datasets for you to practise what you've learnt in this section. I would love to see what you produce with these! 

Post a link to your charts in the comments :-)

Practise datasets for pie charts and donut charts
2 More Sections
About the Instructor
Richard Muir
4.8 Average rating
28 Reviews
372 Students
1 Course
Data Analyst and Visualisation Specialist

Hi I'm Rich. I have a degree in Statistics and Economics from the Open University, and I'm passionate about data.

After working in retail management and teaching for several years, I needed a change and decided to learn how to code. I took loads of courses on Udemy (and have still got a few to do!) and learnt Python, VBA, HTML, CSS and Javascript. 

I've never looked back since!

I worked as a Data Analyst at the Higher Education Funding Council for England where I learnt how to use SAS to analyse large datasets. They also let me loose with different data visualisation libraries and I've been fortunate to be able to contribute to some publications. I made a few Plotly charts for the HEFCE website and blog, as well as many more for internal publications.

I now work for a marketing consultancy where I do predictive modelling of consumer behaviour. They've also let me loose with data visualisation and I'm currently working to integrate Plotly into the workflow, as well as using Tableau and Qlikview to create business reports for global brands.