Scatter Plots and Correlations
Scatter Plots and Correlations
Scatter plots are essential for exploring relationships between two continuous variables. They can reveal correlations, clusters, and outliers that would be invisible in summary statistics.
Basic Scatter Plot
Loading Python Playground...
Visualizing Correlation
The pattern in a scatter plot reveals the correlation:
Loading Python Playground...
Adding Trend Lines
A trend line (regression line) shows the relationship direction:
Loading Python Playground...
Color-Coded Categories
Use color to show a third categorical variable:
Loading Python Playground...
Size as a Third Variable (Bubble Charts)
Use point size to represent a third continuous variable:
Loading Python Playground...
Color Mapping with Colorbar
Map a continuous variable to color:
Loading Python Playground...
Highlighting Outliers
Identify and highlight outliers in your data:
Loading Python Playground...
Quadrant Analysis
Divide your scatter plot into meaningful quadrants:
Loading Python Playground...
Practice: Correlation Analysis
Loading Python Exercise...
Key Takeaways
- Scatter plots reveal relationships between two continuous variables
- The pattern shows correlation: positive (up-right), negative (up-left), or none (random)
- Add trend lines with
np.polyfit()andnp.poly1d() - Use color to show categorical groups or a third continuous variable
- Use size (bubble charts) to add another dimension
- Identify outliers using z-scores or visual inspection
- Quadrant analysis helps categorize data points
In the next lesson, we'll learn to style line and scatter plots for maximum visual impact.

