FirstHack 2026 — a 36-hour online hackathon built for first-year students.•₹1,00,000 prize pool•22 Oct – 4 Nov•Open to every branch and every stream•Certificate for every team that submits•3 rounds•FirstHack 2026 — a 36-hour online hackathon built for first-year students.•₹1,00,000 prize pool•22 Oct – 4 Nov•Open to every branch and every stream•Certificate for every team that submits•3 rounds•
Plotting basics, and how not to mislead with a chart
Four chart types that cover most needs, and the axis tricks that turn a chart into a lie.
12 min read·Lesson 6 of 6·Pro
The four charts you actually need
Chart
Answers
Bar
how do categories compare?
Line
how does something change over time?
Histogram
how is one numeric column distributed?
Scatter
do two numeric columns move together?
Pick by the question, not by which one looks nicer.
Setup
Python 3
import pandas as pd
import matplotlib
matplotlib.use("Agg") # write to a file, no display needed
import matplotlib.pyplot as plt
df = pd.DataFrame({
"branch": ["CSE", "ECE", "MECH", "CIVIL"],
"avg": [78, 71, 65, 68],
"count": [120, 95, 60, 55],
})
The rest of this lesson is Pro
The free lessons of Python for Data Analysis finish what
they start — read those first if you have not. This one goes further, and it
is part of the paid half.
A pass opens the paid lessons of every course, the mock test papers
and the company-wise series. It ends on its own date; nothing renews by itself.