Scatter Plots

A scatter plot visualizes the relationship between two continuous variables by plotting each data point as a dot based on its values along the x and y axes - making it one of the best tools for spotting correlation and patterns between two numeric fields.

What Scatter Plots Reveal

  • Positive correlation - points trend upward from left to right
  • Negative correlation - points trend downward from left to right
  • No correlation - points appear scattered with no clear pattern
  • Outliers - points that sit far away from the general trend
  • Clusters - natural groupings of points that might suggest underlying categories

Plotting in Python

import matplotlib.pyplot as plt

plt.scatter(hours_studied, exam_score, color="teal", alpha=0.7)
plt.xlabel("Hours Studied")
plt.ylabel("Exam Score")
plt.title("Hours Studied vs Exam Score")
plt.show()

Adding a Trend Line

Overlaying a simple regression line on a scatter plot (similar to what you saw in Simple Linear Regression) helps quantify the strength and direction of the relationship rather than relying purely on visual inspection.

Correlation is Not Causation

A strong pattern in a scatter plot only shows association, not cause and effect - two variables can move together due to a third, unmeasured factor influencing both.

When working with large datasets, overlapping points can make a scatter plot hard to read - using transparency (alpha) or switching to a hexbin/density plot can help reveal patterns hidden by overplotting.

You've Completed This Section

This wraps up the core chart types used in Data Visualization - from Bar Charts and Histograms for categories and distributions, through Pie Charts for proportions and Box Plots for spread and outliers, to Scatter Plots for relationships between variables. Together, these form the essential visual toolkit for exploring and communicating data.

Ready to Master Data Science?

Join Uncodemy's Data Science Course and build real, job-ready skills with expert mentors.

Explore Course