Data Visualization Techniques - Scatter, Line, and Histogram

Visualization Techniques

1. Scatter Plots

Scatter plots are deceptively simple and commonly used, but simple doesn’t mean that they aren’t useful!

In a scatter plot, data points are represented individually with a dot, circle, or some other shape. These plots are great for showing the relationship between two variables as we can directly see the raw distribution of the data.

To create a scatter plot in Matplotlib we can simply use the scatter method. Let’s see how by creating a scatter plot with randomly generated data points of many colors and sizes.

First, let’s generate some random data points, x and y, and set random values for colors and sizes because we want a pretty plot:

A complete “runnable” example is at the end.

Get hands-on with 1200+ tech skills courses.