Chapter 11 of 30
Keep learning and build your Data Science skills.
Data Visualization
Learn how charts and graphs communicate patterns in data.
Theory
Data visualization represents information using charts, graphs, and plots.
Common visualizations include:
• Bar charts
• Line charts
• Scatter plots
• Histograms
• Box plots
• Heatmaps
Good visualizations make trends, distributions, relationships, and unusual values easier to understand.
Example
import matplotlib.pyplot as plt
months = ["Jan", "Feb", "Mar"]
sales = [100, 150, 130]
plt.plot(months, sales)
plt.title("Monthly Sales")
plt.xlabel("Month")
plt.ylabel("Sales")
plt.show()Output
A line chart showing monthly sales is displayed.
Practice
Create three different charts for a dataset and explain what each chart shows.
Interview Questions
1
What is data visualization?
2
When should you use a bar chart?
3
What is a scatter plot?
Quick Quiz
Which option best describes this chapter?
A.Communicating data visually
B.Writing backend APIs
C.Creating databases
D.Compiling programs