Search⌘ K
AI Features

Learning about the Different Ways of Using Scatterplots

Learn how to create and customize scatterplots using Plotly's graph_objects and Plotly Express. Understand key parameters like mode to combine markers, lines, and text, and how to filter and visualize data subsets effectively. This lesson helps you gain practical skills in visualizing poverty data through customizable scatterplot traces.

We'll cover the following...

We have a number of different options when using graph_objects to create scatterplots, as mentioned in the introduction, so we will be exploring it together with Plotly Express. To give you an idea of the versatility of the available scatterplots, the following code extracts all the scatter methods available to the Figure object, as well as those available in Plotly Express:

C++
import plotly.express as px
import plotly.graph_objects as go
print([f for f in dir(px) if 'scatter' in f])
fig = go.Figure()
print([f for f in dir(fig) if 'scatter' in f])

Looking at the output, we can see there are some overlaps in the available methods and there are also some methods that aren’t available in both modules. We won’t go into all of them, but it’s good to know them because knowledge of regular scatterplots can be utilized for the other types. Let’s now take a look at some of the differences between using those options.

Markers, lines, and text

One interesting ...