Data Visualization
Simple notes on charts and dashboards for data and business analyst interviews. Each topic has a plain-words box, a small picture, key points, and one thing to remember.
1. Why Visualize Data
Data visualization means showing numbers as pictures: bars, lines, dots and colours. People understand a picture much faster than a table of numbers.
A map of your city is easier than a list of every street with its GPS numbers. Same information, but the map shows the shape at once.
Key points
- Charts help you see patterns: trends going up or down, groups, gaps and odd values.
- Charts help you explain a finding to people who don't have time to read tables (managers, clients).
- Summary numbers can hide things. The average and the correlation can be the same for very different data.
- Anscombe's quartet is the famous example. It is four small data sets. They have the same average, same spread and same correlation. But when you draw them, they look completely different.
- Two jobs of a chart: exploratory (you look at data to find something) and explanatory (you show others what you found).
2. How the Eye Reads Charts
Some things the eye notices instantly, before you even think. These are called pre-attentive attributes. Examples: a different colour, a bigger size, a longer bar, a different position.
In a crowd of people in white shirts, one person in a red shirt jumps out. You don't search for them. Your eye finds them by itself.
Key points
- Main pre-attentive attributes: position, length, colour, size, shape, angle, bold or outline.
- For exact comparison, position and length are best. That is why bar and dot charts are easy to read.
- Angles (pie slices) and areas (bubbles) are hard to compare exactly.
- Colour is best for highlighting one thing, not for reading exact values.
- If everything is highlighted, nothing stands out. Use one highlight per chart.
- Gestalt rules = how the brain groups things. Things that are close or the same colour look like one group. Use this for legends and layout.
3. Kinds of Data
Before you pick a chart, ask: what kind of data is this? A city name, a sales number and a date need different charts.
A tailor first asks "shirt or trousers?" before taking measurements. You first ask "category, number or date?" before drawing.
Key points
- Categorical (nominal) = names or groups with no order. Example: city, product, payment method.
- Ordinal = groups that have an order. Example: small / medium / large, or a 1–5 star rating.
- Numeric (quantitative) = numbers you can add or average. Example: sales, age, price.
- Time = dates and times. Usually shown left to right on the x-axis.
- Geographic = places: country, state, pin code, latitude and longitude.
- In Power BI and Tableau you will hear dimension (a category you group by, like Region) and measure (a number you add up, like Sales).
| Data type | Example | Usual place in a chart |
|---|---|---|
| Categorical | Region, product | Bars, colour of groups |
| Ordinal | Rating 1–5, size S/M/L | Bars in their natural order |
| Numeric | Revenue, quantity | Bar length, y-axis, dot position |
| Time | Month, date | x-axis of a line chart |
| Geographic | State, city | Map |
4. Picking the Right Chart
Don't start with "Which chart looks cool?". Start with "What question am I answering?". The question decides the chart.
You pick a tool by the job. A hammer for nails, a screwdriver for screws. A line chart for trends, a bar chart for comparing.
The six common questions
- Comparison — which is bigger? Example: sales by city.
- Trend — how does it change over time? Example: monthly users.
- Part-to-whole — what share does each part have? Example: market share.
- Distribution — how are values spread? Example: ages of customers.
- Relationship — does one thing move with another? Example: ad spend vs sales.
- Geography — where does it happen? Example: sales by state.
| Question | Best chart | Also OK | Avoid |
|---|---|---|---|
| Comparison | Bar chart (sorted) | Dot plot, grouped bar | Pie, 3D bars |
| Trend over time | Line chart | Area chart, column chart (few periods) | Pie, unsorted bars |
| Part-to-whole | Stacked bar, 100% bar | Pie/donut (2–4 parts), treemap | Pie with 8+ slices |
| Distribution | Histogram | Box plot, violin plot | Pie, line chart |
| Relationship | Scatter plot | Bubble chart, heatmap | Two separate bar charts |
| Geography | Filled map (choropleth) | Bubble map | A map when location doesn't matter |
| One key number | KPI card | Bullet chart | Gauge with lots of decoration |
| Exact values to look up | Table | Table with colour (heat table) | Chart with 50 labels |
5. Tables vs Charts
A table is best when people need to look up exact numbers. A chart is best when people need to see a pattern or shape.
A train timetable is a table: you want your exact time. A weather forecast graph is a chart: you want to see "it gets colder this week".
| Use a table when… | Use a chart when… |
|---|---|
| People need exact values (₹4,21,350) | People need the shape or trend |
| You compare many different measures per row | You compare one or two measures |
| The audience will search for their own row | You want to show one message quickly |
| Finance, audit, detail reports | Presentations, dashboards, summaries |
Key points
- Make tables easy to read: align numbers to the right, text to the left, use the same decimal places.
- Remove heavy borders. Light row lines or light zebra stripes are enough.
- A heat table (table with background colour by value) mixes both: exact values plus a quick pattern.
- Dashboards often show charts on top and a detail table at the bottom.
6. Bar Chart
A bar chart shows one bar per category. The longer the bar, the bigger the value. It is the most useful chart you will ever make.
Like children standing in a line by height. You instantly see who is tallest and who is shortest.
Key points
- Use it for: comparing values across categories (cities, products, teams).
- Column chart = vertical bars. Bar chart = horizontal bars. Use horizontal when names are long or there are many categories.
- Sort bars from biggest to smallest (unless the order means something, like months or age groups).
- The axis must start at zero. The bar length is the value, so a cut axis lies.
- Label values directly on the bars, then you can often remove the axis and gridlines.
- Don't use it for: long time series with many points (use a line), or showing a distribution (use a histogram).
7. Grouped & Stacked Bars
A grouped bar puts bars side by side inside each group. A stacked bar puts the parts on top of each other, so the full bar is the total.
Grouped is like two kids standing next to each other to compare height. Stacked is like stacking boxes to see how tall the whole pile is.
Key points
- Grouped bar: use when comparing sub-groups is the main point. Keep it to 2–3 bars per group.
- Stacked bar: use when the total matters most, and you also want a rough idea of the parts.
- Only the bottom segment of a stacked bar is easy to compare. The others "float".
- 100% stacked bar: every bar is the same height (100%). Good for comparing shares, like "% of sales online vs in-store" by year.
- Don't stack more than 3–4 segments. It becomes a colourful puzzle.
8. Line Chart
A line chart joins points with a line to show how a number changes over time. Time goes left to right.
Like a heart-rate monitor in a hospital. You don't care about one beat. You care whether the line is steady, going up or dropping.
Key points
- Use it for: trends over time — daily users, monthly revenue, stock price.
- A line chart does not have to start at zero. It shows change, not size. But don't zoom in so much that tiny noise looks dramatic.
- Keep it to about 3–5 lines. More lines become "spaghetti". Highlight one, make the rest grey.
- Label lines at their end instead of using a far-away legend.
- Time steps must be equal. Don't mix days and months on one axis.
- Don't use it for: categories with no order (cities, products). A line between "Delhi" and "Pune" means nothing.
9. Area Chart
An area chart is a line chart with the space below the line filled in. The filling shows volume or a running total.
Like water filling a tank over time. You see the level, and you also feel how much water there is.
Key points
- Use it for: totals over time, like total users or cumulative sales.
- Stacked area shows how parts add up to a total over time (e.g. users from Android, iOS, web).
- Because the area is filled, the axis should start at zero (unlike a plain line chart).
- In stacked areas, only the bottom layer is easy to read. Keep to 2–4 layers.
- Don't use it when lines cross a lot. Overlapping areas hide each other.
10. Pie & Donut Charts
A pie chart is a circle cut into slices. Each slice is a share of the whole (all slices add up to 100%). A donut is a pie with a hole in the middle.
Like cutting a pizza. Easy to see "half" or "a quarter". Very hard to see whether a slice is 24% or 26%.
Key points
- Use a pie only when: you show parts of one whole, there are 2–4 slices, and one share is the message (e.g. "70% of orders are on mobile").
- Slices must add up to 100%. Never use a pie for values that overlap (e.g. "% who like tea" and "% who like coffee").
- Start the biggest slice at 12 o'clock and go clockwise, largest to smallest.
- Never use 3D pies. The tilt makes front slices look bigger than they are.
- Don't use a pie to compare across time or groups (two pies side by side are very hard to compare). Use a 100% stacked bar.
- Donut = same rules. The hole is a good place for the total.
11. Scatter Plot
A scatter plot puts one dot per item. The x position is one number, the y position is another. It shows whether two numbers move together.
Plot every student: hours studied (across) and exam marks (up). If the dots climb from left to right, more study tends to mean more marks.
Key points
- Use it for: relationships between two numbers — price vs demand, age vs spend, ad spend vs sales.
- Patterns: dots going up = positive, going down = negative, a cloud = no relationship.
- A trend line (regression line) shows the general direction.
- Correlation is not causation. Ice-cream sales and drowning both rise in summer. Ice cream doesn't cause drowning; hot weather drives both.
- Too many dots overlap (overplotting). Fix: make dots see-through, smaller, or use a heatmap.
- Bubble chart = scatter where dot size is a third number. Use with care: area is hard to read.
12. Histogram
A histogram shows how values are spread out. It cuts the number range into equal buckets (called bins) and counts how many values fall in each bucket.
Sort exam papers into piles: 0–10 marks, 10–20, 20–30 and so on. The height of each pile is the histogram bar.
Key points
- Use it for: distribution of one number — ages, salaries, delivery times, order values.
- It shows the shape: normal (bell), skewed (long tail on one side), or two peaks (bimodal, often two groups mixed).
- Histogram vs bar chart: a histogram's x-axis is a number range, and bars touch. A bar chart's x-axis is categories, and bars have gaps.
- Bin size changes the picture. Too few bins hide detail; too many look noisy. Try a few sizes.
- In a right-skewed shape, the mean is bigger than the median. That is why we often report median salary or median house price.
13. Box Plot
A box plot (box-and-whisker plot) squeezes a whole distribution into five numbers: minimum, Q1, median, Q3, maximum. It also shows outliers as single dots.
Like a quick summary of a class's marks: lowest, a quarter-way mark, middle mark, three-quarter mark, highest — and the one student who scored oddly.
Key points
- Median = the middle value. Q1 = 25% of values are below it. Q3 = 75% are below it.
- IQR (interquartile range) = Q3 − Q1. It is the width of the box: the middle 50% of the data.
- Common outlier rule: a value below Q1 − 1.5×IQR or above Q3 + 1.5×IQR.
- Use it for: comparing distributions across groups — e.g. delivery time by city, salary by department, side by side.
- A long box or long whisker = values are very spread out. A median not in the middle of the box = skewed data.
- Weakness: it hides shape (e.g. two peaks). A violin plot or histogram shows the shape.
14. Heatmap
A heatmap is a grid where each cell's colour shows a value. Darker usually means more. It shows patterns across two categories at once.
Like a school timetable where busy periods are coloured dark. One glance shows which day and which hour is the busiest.
Key points
- Use it for: two categories plus one number — day × hour, product × region, or a correlation matrix (how strongly each pair of columns is related).
- Use one colour from light to dark (sequential) for "low to high". Use two colours (diverging) when there is a middle point, like correlation from −1 to +1.
- Always show a colour legend. Add numbers in cells if exact values matter.
- Colour is less exact than length. A heatmap shows patterns, not precise comparisons.
- Sort rows and columns in a sensible order (time order, or by total) so patterns appear.
15. Maps
A choropleth map (say "KOR-oh-pleth") colours each region, like a state, by a value. A bubble map puts a circle on each place; bigger circle = bigger value.
Like a weather map on the news. Darker areas get more rain. You see the "where" at once.
Key points
- Use a map only when location matters to the question. If not, a sorted bar chart of regions is easier to read.
- For choropleths, use rates or per-person values (% or per 1,000 people), not raw totals. Raw totals just show "where many people live".
- Big regions look important even if few people live there. Small but important areas (cities) can disappear.
- Use a sequential colour scale (light to dark) and show the legend.
- Bubble maps are better for totals (e.g. sales per city) because circle size shows amount.
- Power BI and Tableau can draw maps from state or city names. Check the names match (e.g. "Orissa" vs "Odisha").
16. KPI Cards & Other Charts
A KPI (Key Performance Indicator) is one important number the business watches, like revenue or churn rate. A KPI card shows that number big, with a comparison so people know if it is good or bad.
Like a car's dashboard: speed, fuel, temperature. Big, simple numbers you check in one second while driving.
Key points
- A good KPI card has: a clear label, the number, a comparison (vs last month, vs target) and maybe a sparkline (a tiny line chart with no axes).
- A number alone means little. "₹4.2 Cr" — is that good? The comparison answers that.
- Green/red should mean good/bad, not up/down. A falling return rate is good news.
- Waterfall chart = shows how a starting value becomes an end value, step by step (e.g. last year's profit + sales − costs = this year's profit).
- Funnel chart = shows drop-off between steps, e.g. visit → add to cart → checkout → paid.
- Treemap = nested rectangles sized by value. Good for many parts of a whole (e.g. sales by category and sub-category).
- Bullet chart = a bar with a target marker. Better than a gauge (speedometer), which wastes space.
17. Using Colour
Colour is powerful, so use it on purpose. There are three kinds of colour scales: sequential, diverging and categorical.
Colour is like a highlighter pen. One highlighted line on a page stands out. If you highlight the whole page, nothing stands out.
Key points
- Sequential: one colour, light to dark. For amounts (sales, population).
- Diverging: two colours with a neutral middle. For values above/below something (profit vs loss, vs target, correlation −1 to +1).
- Categorical: clearly different colours for groups with no order. Don't use a light-to-dark scale for unordered groups.
- Use colour sparingly. Make most things grey and colour only what matters. That is the strongest highlight there is.
- Colour-blind safety: about 1 in 12 men have trouble telling red from green. Avoid red-vs-green as the only difference. Blue vs orange is a safe pair.
- Never rely on colour alone. Also use labels, position or patterns.
- Keep colours consistent: if "North" is blue on one chart, it is blue on every chart in the dashboard.
- Avoid the rainbow scale. Its bright bands create fake boundaries in the data.
18. Declutter & Data-Ink Ratio
Clutter is anything on the chart that doesn't help the reader: heavy borders, dark gridlines, 3D effects, shadows, extra decimals. Data-ink ratio (an idea from Edward Tufte) means: most of the "ink" should show data, not decoration.
Like a messy desk. You can't find the important paper because it is buried under junk. Clear the desk and the paper is obvious.
Key points
- Remove: 3D effects, shadows, background images, heavy borders, dark gridlines, unneeded legends.
- Make gridlines light grey or remove them if values are labelled.
- Label directly (next to the bar or line) instead of a separate legend. The eye doesn't have to jump back and forth.
- Round numbers: "₹4.2 Cr", not "₹4,21,53,876.37".
- Use white space. Empty space is not wasted; it helps the eye rest and group things.
- Ask for every element: "If I delete this, does the reader lose anything?" If not, delete it.
19. Axes & Scales
The axis is the ruler of a chart. If the ruler is stretched, cut or doubled, the picture can lie even when the numbers are true.
A shop that says "huge sale!" in giant letters, while the discount is 2%. The size of the message doesn't match the size of the truth.
Key points
- Bar and area charts must start at zero. The length or area is the value. Cutting the axis makes small gaps look huge.
- Line charts can start above zero, because they show change. But label the axis clearly, and don't exaggerate tiny wiggles.
- Dual-axis charts (two y-axes, one left, one right) are risky. You can stretch either axis to make two lines "cross" or "move together" at will. Readers also mix up which line uses which axis.
- Better than a dual axis: two small charts stacked one above the other with the same x-axis, or index both series to 100 at the start.
- Log scale = each step is ×10 (1, 10, 100, 1000). Useful when values range from very small to very big, or for growth rates. Always label it "log scale".
- Use the same scale when you put small charts side by side (called small multiples). Otherwise readers compare wrongly.
- Label units: ₹, %, thousands, lakh, crore. "Sales: 4.2" means nothing.
20. Titles & Labels
A good chart title tells the reader what to see, not just what the data is. This is called an action title or insight title.
A newspaper headline says "Prices rise 8% in a month", not "Prices table". It tells you the news in one line.
| Weak title (just a label) | Strong title (states the insight) |
|---|---|
| Sales by Region | South grew fastest in Q3, up 24% |
| Monthly Churn | Churn doubled after the price change in June |
| Delivery Time by City | Pune deliveries take 2 days longer than any other city |
Key points
- Title = the message. Subtitle = the details (what is measured, units, time period, source).
- Label axes with name and unit: "Revenue (₹ lakh)". Remove an axis title if it is obvious (e.g. months).
- Use annotations: a small note on the chart like "Price change here" or "Diwali sale".
- Write numbers in the format your audience uses (lakh/crore for Indian business, K/M for global).
- Avoid tilted or vertical text. If labels don't fit, turn the chart into horizontal bars.
- Mention the data source and date at the bottom. It builds trust.
21. Misleading Charts
A chart can use true numbers and still give a false impression. Interviewers love asking you to spot these tricks.
Like a photo taken from a low angle to make a small house look like a mansion. Nothing is fake, but the angle lies.
Common tricks to spot
- Truncated axis: bar chart starts at 49, not 0. Small differences look massive.
- 3D pie or 3D bars: the tilt makes front slices look bigger than back slices.
- Cherry-picked range: showing only the 3 good months and hiding the bad year around them.
- Dual axis abuse: stretching one axis so two unrelated lines seem to move together.
- Uneven time steps: 2010, 2015, 2020, 2021, 2022 spaced equally — growth looks faster than it was.
- Area/size tricks: doubling both height and width of an icon makes it look 4× bigger, not 2×.
- Totals instead of rates: "most crime happens in big cities" — because most people live there.
- Missing context: "sales up 50%" — from 2 orders to 3.
22. Accessibility
Accessibility means everyone can understand your chart, including people with colour-blindness, low vision, or who use a screen reader (software that reads the screen aloud).
Like a building with a ramp and stairs. The ramp doesn't hurt anyone, and it lets many more people in.
Key points
- Don't rely on colour alone. Add labels, shapes, line styles (solid/dashed) or patterns.
- Use colour-blind safe palettes (blue/orange). Test with a simulator (Tableau and many online tools have one).
- Contrast: text and lines must be dark enough against the background. Light grey text on white is hard to read.
- Use readable font sizes (at least 12px on screen). Avoid tiny axis labels.
- Add alt text (a short text description of the chart): what it shows and the main finding.
- Provide the data table as an option. Power BI has "Show as table"; screen readers can read tables.
- Keyboard support: filters and buttons should work without a mouse.
23. Dashboard Design
A dashboard is one screen with several charts and numbers, used to monitor how the business is doing. Usually it updates automatically.
Like the cockpit of a plane. The most important dials sit right in front of the pilot. Less urgent ones are placed around them.
Key points
- Know the audience first. A CEO wants 4–5 big numbers. A sales manager wants detail by rep and region.
- Know the purpose: strategic (long-term, monthly), operational (live, daily: "what's happening now?"), or analytical (explore and find causes).
- People read screens in an F-pattern or Z-pattern: top-left first, then across, then down. Put the most important thing top-left.
- KPIs at the top, trends and breakdowns in the middle, detail tables at the bottom.
- Keep to about 5–9 visuals on one page. If it needs scrolling, it may need a second page.
- Use a grid: align charts, equal spacing, same fonts. It looks professional and is easier to scan.
- Keep colours and number formats consistent across all charts.
- Show the last refresh time, so people know how fresh the data is.
24. Filters, Interactivity & Drill-down
Interactivity lets users explore the dashboard themselves: choose a region, hover to see a value, click to go deeper.
Like Google Maps. You start with the whole country, then zoom into your state, your city, your street.
Key points
- Filter / slicer = a control (dropdown, list, date range) that limits the data shown, e.g. "Region = South". "Slicer" is the Power BI word.
- Cross-filtering = clicking a bar in one chart filters all other charts on the page.
- Drill-down = going from summary to detail in a hierarchy: Year → Quarter → Month → Day, or Country → State → City.
- Drill-through = clicking jumps to a separate detail page for that item (e.g. one customer's full history).
- Tooltip = the small box that appears on hover with exact values and extra info.
- Show the active filters clearly. Wrong numbers often come from a hidden filter someone forgot.
- Don't add interactivity just because you can. Every filter is one more thing to understand.
- Static report vs dashboard: a report (PDF, slides) tells one story; a dashboard is for ongoing monitoring and exploring.
25. Storytelling with Data
Data storytelling means using data, charts and a short story to lead people to a decision. Charts show what happened; the story explains why it matters and what to do.
A doctor doesn't just hand you test results. They say: "Your sugar is high (data). That's why you feel tired (meaning). Walk 30 minutes daily (action)."
The four building blocks
- Context: who is the audience, what do they already know, what decision do they need to make?
- Audience: executives want the answer first; analysts want the method. Change the depth, not the truth.
- Big idea: your whole message in one sentence. Example: "Late deliveries in Pune are causing 40% of our refunds, so we should switch courier."
- Narrative arc: beginning, middle, end — setup, problem, solution.
Key points
- One chart = one message. Each slide's title is that message.
- Use the highlight (one colour, an annotation) to point at the exact part of the chart you are talking about.
- Answer "So what?" for every number. If you can't, drop the chart.
- End with a clear recommendation or next step.
- Explore with 50 charts; present 3. The audience does not need to see your whole journey.
26. Tools Landscape
Many tools can make charts. The ideas are the same in all of them. Companies pick based on cost, data size and what they already use.
Like cars: a hatchback, a sedan and an SUV all drive the same way. Learn to drive well in one, and switching is easy.
| Tool | Best for | Strengths | Limits |
|---|---|---|---|
| Excel | Quick charts, small data, ad-hoc analysis | Everyone has it; pivot tables + pivot charts | Slow with big data; limited interactivity |
| Power BI | Company dashboards (Microsoft shops) | Cheap, Power Query for cleaning, DAX for measures, links with Excel/Teams | DAX takes time to learn; desktop app is Windows-only |
| Tableau | Rich, interactive visual analysis | Drag-and-drop, beautiful charts, strong community (Tableau Public) | Costly licences |
| Looker Studio | Free web dashboards, Google data | Free, easy sharing, connects to Google Sheets/Analytics/BigQuery | Fewer features, slower on big data |
| Python: matplotlib | Full control, static charts | Can draw anything; base of other libraries | Lots of code for a nice chart |
| Python: seaborn | Statistical charts fast | One line for histograms, box plots, heatmaps; nice defaults | Static; less control than matplotlib |
| Python: plotly | Interactive charts in notebooks and web apps | Hover, zoom out of the box; Dash for web apps | Bigger files; extra learning |
Key points
- For fresher analyst roles, know Excel well and one BI tool (Power BI or Tableau) to a project level.
- BI = Business Intelligence: tools that connect to data, clean it, and build shareable dashboards.
- Power BI words: Power Query (clean/transform data), data model (tables + relationships), DAX (formulas for measures), slicer (filter).
- Tableau words: dimensions/measures, sheets (one chart), dashboards (many sheets), calculated fields, LOD expressions.
- Python is for analysts who also clean data and do statistics in code (Jupyter notebooks).
27. Python Charts (matplotlib & seaborn)
matplotlib is the basic Python charting library. seaborn sits on top of it and makes statistical charts with less code. pandas holds the data as a table (a DataFrame).
matplotlib is like cooking from scratch. seaborn is like a ready meal kit: faster, still tasty, a bit less control.
A clean bar chart with matplotlib
import matplotlib.pyplot as plt
import pandas as pd
df = pd.DataFrame({"city": ["Mumbai", "Delhi", "Bengaluru", "Pune", "Jaipur"],
"sales": [92, 78, 65, 41, 28]})
df = df.sort_values("sales") # sort so the biggest is on top
fig, ax = plt.subplots(figsize=(7, 4))
colors = ["#bbbbbb"] * len(df) # grey for all bars...
colors[-1] = "#2f6f4e" # ...one highlight for the top city
ax.barh(df["city"], df["sales"], color=colors) # horizontal bars
ax.set_title("Mumbai leads January sales (₹ lakh)", loc="left") # insight title
for side in ["top", "right"]:
ax.spines[side].set_visible(False) # remove chart junk (extra borders)
for i, v in enumerate(df["sales"]):
ax.text(v + 1, i, str(v), va="center") # label each bar directly
plt.tight_layout()
plt.savefig("sales.png", dpi=150) # save for slides/reports
Distribution and relationship with seaborn
import seaborn as sns
import matplotlib.pyplot as plt
tips = sns.load_dataset("tips") # sample restaurant data
sns.histplot(data=tips, x="total_bill", bins=20) # histogram
plt.show()
sns.boxplot(data=tips, x="day", y="total_bill") # box plot per day
plt.show()
sns.scatterplot(data=tips, x="total_bill", y="tip", hue="time") # scatter, colour by group
plt.show()
corr = tips[["total_bill", "tip", "size"]].corr() # correlation table
sns.heatmap(corr, annot=True, cmap="RdBu", vmin=-1, vmax=1) # diverging colours, -1 to +1
plt.show()
Key points
fig, ax = plt.subplots()gives you a figure (the canvas) and axes (the chart area). Set titles and labels onax.plt.subplots(1, 3)makes small multiples: three charts side by side.- seaborn's
hue=colours points by a category.sns.pairplot(df)draws a scatter for every pair of columns — great for exploring. - For the correlation heatmap, use a diverging colour map with
vmin=-1, vmax=1so 0 is the neutral middle. - For interactive charts,
plotly.expressworks almost the same:px.bar(df, x="city", y="sales").
Quick Revision
The most-asked questions, with short and simple answers. Say these in your own words.
Basics
- Why visualize data? People see patterns, trends and outliers much faster in a picture than in a table.
- What is Anscombe's quartet? Four data sets with the same summary stats that look completely different when plotted. Lesson: always plot your data.
- What are pre-attentive attributes? Things the eye notices instantly: colour, size, length, position, shape.
- Which is most accurate for comparison? Position and length. Angle and area are the weakest.
- Dimension vs measure? Dimension = category you group by (Region). Measure = number you add up (Sales).
- Exploratory vs explanatory? Exploratory = you search the data. Explanatory = you show one finding to others.
Choosing charts
- Compare categories? Sorted bar chart.
- Trend over time? Line chart.
- Part of a whole? Stacked or 100% bar; pie only with 2–4 slices.
- Distribution? Histogram or box plot.
- Relationship between two numbers? Scatter plot.
- By location? Choropleth (rates) or bubble map (totals).
- Why are pie charts often criticised? People can't compare angles well, especially with many or similar slices.
- Histogram vs bar chart? Histogram: number ranges, bars touch, shows spread. Bar chart: categories, gaps, compares values.
- What does a box plot show? Min, Q1, median, Q3, max, and outliers beyond 1.5 × IQR.
- Grouped vs stacked bar? Grouped compares parts; stacked compares totals.
- Table or chart? Table to look up exact values; chart to see a pattern.
Design
- Three types of colour scale? Sequential (low→high), diverging (around a middle), categorical (separate groups).
- How do you make charts colour-blind friendly? Avoid red-vs-green only, use blue/orange, add labels and patterns.
- What is the data-ink ratio? Most of the ink should show data. Remove decoration that adds nothing.
- Must a bar chart start at zero? Yes. The bar length is the value. Line charts may start higher.
- Why avoid dual axes? Either axis can be stretched to fake a relationship, and readers mix up the scales.
- What is a good chart title? One that states the insight: "Churn doubled after June's price change".
- Name ways charts mislead. Truncated axis, 3D effects, cherry-picked dates, dual axes, totals instead of rates.
Dashboards & stories
- How do you design a dashboard? Know the audience and question, KPIs top-left, trends in the middle, detail at the bottom, few colours, 5–9 visuals.
- What is an F/Z pattern? The order people scan a screen: top-left first, then across, then down.
- Drill-down vs drill-through? Drill-down = go deeper in a hierarchy in the same chart. Drill-through = jump to a detail page.
- What is a KPI card? One key number with a label and a comparison (vs target or last period).
- What is data storytelling? Context + chart + narrative leading to an action.
- What is the "big idea"? Your whole message and recommendation in one sentence.
- Power BI vs Tableau? Power BI: cheaper, Microsoft-friendly, DAX. Tableau: very flexible visuals, costlier. Principles are the same.
Learning Path
Go step by step. Make real charts at each step.
- Chart basics — bar, line, pie, scatter, histogram. Know when to use each one.
- Excel charts — make charts from a pivot table. Practise sorting, labelling and removing clutter.
- Design rules — colour, zero baseline, insight titles. Redo a bad chart from the news in a clean way.
- Statistics for charts — mean vs median, quartiles, outliers, correlation. Then box plots make sense.
- One BI tool — Power BI or Tableau. Learn to connect data, clean it, build measures, add slicers.
- Project — build a one-page sales or HR dashboard from a public data set (Kaggle). KPIs on top, filters, drill-down.
- Storytelling — turn your dashboard into 3–5 slides with action titles and a recommendation.
- Python (optional but useful) — pandas + matplotlib/seaborn in a Jupyter notebook.
- Portfolio — publish to Tableau Public, Power BI (screenshots + a short write-up) or GitHub. Link it on your CV.