Python for Data Science

Chapter 10
Data Visualization and Analytical Communication

Advance Diploma in Data Science
Python for Data Science   •   Advance Diploma

Data Visualization and Analytical Communication

Introduction

Data visualization is the disciplined transformation of data into visual representations that help people detect patterns, compare alternatives, understand uncertainty, and make decisions. In data science, visualization is not merely the final presentation of analysis. It is also an exploratory instrument used to discover errors, formulate hypotheses, evaluate models, and communicate evidence to technical and non-technical audiences.

A technically correct chart can still fail if it uses an unsuitable visual encoding, hides uncertainty, excludes people with disabilities, or presents an analytical result without a decision context. Effective analytical communication therefore combines statistical reasoning, visual design, programming, narrative structure, and professional judgment.

This chapter focuses on Python-based visualization using Matplotlib, Seaborn, and interactive tools. It also examines chart selection, accessibility, dashboard design, narrative reporting, ethical issues, and decision-focused communication.

Learning Objectives

By the end of this chapter, you should be able to:

  1. Explain the role of visualization in exploratory and explanatory data analysis.
  2. Select chart types according to analytical purpose and data structure.
  3. Construct clear static visualizations with Matplotlib and Seaborn.
  4. Build interactive visualizations using Plotly and dashboard frameworks.
  5. Apply principles of accessibility, truthful representation, and visual integrity.
  6. Design dashboards and reports around decisions rather than decoration.
  7. Communicate findings with appropriate context, uncertainty, and limitations.
  8. Evaluate visualizations critically and improve them through iteration.

1. Visualization as Analytical Reasoning

A visualization maps data variables to visual attributes such as position, length, area, colour, shape, and size. The quality of a chart depends on whether the mapping supports the intended task. Position along a common scale is generally easier to compare accurately than area or colour intensity. Consequently, a dot plot or bar chart is often preferable to a pie chart when precise comparison is required.

Visualization serves two complementary purposes:

  • Exploratory visualization supports investigation. The analyst may generate many provisional charts to identify outliers, missing values, nonlinear relationships, clusters, or changes over time.
  • Explanatory visualization supports communication. The analyst selects a small number of carefully designed charts to explain a conclusion, support a recommendation, or enable monitoring.

The distinction is important. Exploratory charts may be untidy because speed and discovery are priorities. Explanatory charts must be edited so that the audience can understand the evidence without access to the analyst’s entire workflow.

A useful analytical communication chain is:

Data → Question → Visual encoding → Interpretation → Decision → Action

Weak visualization often begins with a chart type rather than a question. Asking “What decision should this audience make?” helps determine what information should be emphasized.

1.1 Data types and visual tasks

Chart selection begins with the variables and the analytical task.

Data structureTypical questionSuitable visual forms
One categorical variableHow frequent is each category?Bar chart, ordered dot plot
One quantitative variableWhat is its distribution?Histogram, density plot, box plot
Two quantitative variablesAre the variables associated?Scatter plot, hexbin plot
Time and one measureHow does the measure change?Line chart, area chart
Two categorical variablesHow do groups compare?Grouped or stacked bars, heat map
Quantitative measure across groupsWhich groups differ?Dot plot, box plot, violin plot
Geographic dataWhere are values concentrated?Choropleth or symbol map
Hierarchical parts of a wholeHow is a total composed?Treemap, carefully used stacked bars

A variable’s measurement level also matters. Nominal categories have no inherent order; ordinal categories have an order; interval measurements have meaningful differences but not necessarily a meaningful zero; ratio measurements have a meaningful zero. Treating nominal categories as numeric can create false relationships, while treating ordered categories as unordered can conceal structure.

2. Principles of Effective Visual Encoding

2.1 Accuracy and perceptual effectiveness

A chart should make the relevant comparison easy. The usual preference order for quantitative comparison is approximately:

  1. Position on a common scale.
  2. Position on aligned but separate scales.
  3. Length.
  4. Angle or slope.
  5. Area.
  6. Colour intensity or volume.

This is not an absolute law. A map, for example, may be necessary when location is the central question. However, the principle explains why a bar chart is usually more precise than a pie chart for comparing category values.

2.2 Scale, baselines, and transformations

Bar charts encode magnitude through length, so a zero baseline is normally necessary. Truncating the vertical axis can exaggerate differences. Line charts do not always require a zero baseline because they often emphasize change and trend, but the axis range must still be disclosed and interpreted carefully.

Logarithmic scales can be appropriate when values span several orders of magnitude or when multiplicative change is important. If a logarithmic axis is used, it must be labelled clearly and explained to audiences unfamiliar with it. A log scale changes visual interpretation: equal distances represent equal ratios, not equal absolute differences.

Transformations can also improve analysis. For example, plotting revenue on a logarithmic scale may reveal proportional growth across firms of very different sizes. The transformation should never be used merely to make an undesirable result look more impressive.

2.3 Colour

Colour should have a defined semantic role. A sequential palette represents ordered magnitude, a diverging palette represents deviation around a meaningful midpoint, and a qualitative palette distinguishes categories without implying order.

Use colour sparingly. Excessive colours increase cognitive load, and red–green combinations may be inaccessible to people with colour-vision deficiencies. Important distinctions should also be represented with labels, position, line style, or symbols.

2.4 Uncertainty and variation

A mean without an indication of variation can mislead. Depending on the question, uncertainty may be shown using standard deviation, standard error, confidence intervals, prediction intervals, quantiles, or raw observations. These are not interchangeable.

For a sample mean, a commonly used approximate confidence interval is:

x̄ ± t* × SE(x̄)

Here, x̄ is the sample mean, t* is a critical value from the appropriate t-distribution, and SE(x̄) is the standard error of the mean. The interval is appropriate under the assumptions of the chosen inferential procedure, including an appropriate sampling design and a model suitable for the data. It is not automatically a range containing all individual observations.

For a sample with standard deviation s and size n, the standard error of the mean is:

SE(x̄) = s ÷ √n

This formula describes uncertainty in the estimated mean, not the spread of individual values. A visualization should state what error bars represent.

3. Matplotlib: Controlled Static Visualization

Matplotlib is a foundational Python library for static, publication-quality graphics. Its object-oriented interface is particularly useful when several plots, axes, annotations, or customized elements are required.

import matplotlib.pyplot as plt
import pandas as pd

monthly = pd.DataFrame({
    "month": ["Jan", "Feb", "Mar", "Apr"],
    "sales": [120, 145, 138, 170]
})

fig, ax = plt.subplots(figsize=(8, 4.5))
ax.plot(monthly["month"], monthly["sales"], marker="o", linewidth=2)
ax.set_title("Monthly sales increased after February")
ax.set_xlabel("Month")
ax.set_ylabel("Sales (units)")
ax.grid(axis="y", alpha=0.25)
fig.tight_layout()
plt.show()

The fig object represents the complete figure and ax represents an axes region. Explicitly using these objects makes code more predictable than relying on implicit global state.

Important Matplotlib practices include:

  • label both axes and include units;
  • use informative titles rather than vague titles such as “Results”;
  • choose figure dimensions suitable for the delivery medium;
  • use annotations to direct attention to meaningful events;
  • remove unnecessary borders and gridlines;
  • use tight_layout() or constrained layout to prevent clipped labels;
  • save with an appropriate resolution and file format.

For reports, vector formats such as SVG or PDF may preserve quality during scaling. Raster formats such as PNG are convenient for web use. The appropriate choice depends on the publication system and accessibility requirements.

3.1 Subplots and small multiples

Small multiples repeat a consistent chart structure across groups. They are often better than placing many categories in one overloaded chart because each panel preserves a common visual grammar. Axes should be comparable unless there is a strong reason to use independent scales; independent scales can reveal within-group patterns but make cross-group comparison difficult.

4. Seaborn: Statistical Graphics and Data Relationships

Seaborn builds on Matplotlib and provides a high-level interface for statistical graphics. It works naturally with tidy data, where each observation is a row and each variable is a column.

import seaborn as sns
import matplotlib.pyplot as plt

penguins = sns.load_dataset("penguins").dropna()

fig, ax = plt.subplots(figsize=(7, 5))
sns.scatterplot(
    data=penguins,
    x="bill_length_mm",
    y="bill_depth_mm",
    hue="species",
    style="sex",
    alpha=0.75,
    ax=ax
)
ax.set_title("Bill dimensions by penguin species")
ax.set_xlabel("Bill length (mm)")
ax.set_ylabel("Bill depth (mm)")
ax.legend(title="Group")
fig.tight_layout()
plt.show()

Seaborn can produce box plots, violin plots, regression plots, heat maps, pair plots, and faceted charts. A box plot summarizes a distribution using the median, quartiles, and potential outliers. It does not display every observation and can conceal multimodality. A violin plot displays an estimated density and can reveal multiple peaks, but its shape depends on smoothing choices. For small samples, overlaying individual observations is often useful.

A correlation heat map is useful for screening relationships, but correlation does not establish causation. Moreover, a correlation coefficient may fail to represent nonlinear relationships, be distorted by outliers, or reflect confounding variables.

numeric = penguins.select_dtypes("number")
correlation = numeric.corr()

sns.heatmap(correlation, annot=True, cmap="vlag", center=0, fmt=".2f")
plt.title("Correlation among numeric variables")
plt.tight_layout()
plt.show()

The annotation format .2f displays values to two decimal places; it does not make the underlying estimates more precise.

5. Choosing Charts for Analytical Questions

Comparison

Use bars, dots, or lines to compare values. Sort categories when ranking is important. Avoid relying on alphabetical order if it obstructs the comparison.

Distribution

Histograms show counts or proportions within bins. Bin width affects the apparent distribution, so analysts should examine more than one reasonable binning choice. Density plots provide a smoothed estimate and should not be interpreted as raw counts. Box plots are compact for group comparisons but should be supplemented when distribution shape matters.

Relationship

Scatter plots are suitable for two quantitative variables. Add a fitted line only when it represents a justified model or descriptive smoother. A fitted line can encourage viewers to infer causation, so the title or caption should identify the relationship as associative unless a causal design supports stronger language.

Time series

Time should usually be placed on the horizontal axis and ordered chronologically. Line charts are appropriate for continuous or regularly observed time. Missing observations should not silently be connected as if measurements existed. Seasonal patterns, structural breaks, and changes in measurement practice should be documented.

Part-to-whole

A pie chart is defensible when there are few categories, the total is meaningful, and approximate proportions are sufficient. For precise comparisons, a sorted bar chart is usually superior. Stacked bars can show composition but make interior segments difficult to compare across groups.

Maps

Maps are appropriate when geographic location is analytically meaningful. Choropleth maps should generally use normalized values, such as incidents per population, rather than raw counts when population sizes differ. Classification thresholds and missing areas must be disclosed. A map can create a false impression of importance when large geographic areas have small populations.

6. Interactive Visualization

Interactive graphics allow users to filter, zoom, hover, drill down, and inspect details. They are valuable when the audience needs to explore multiple dimensions or when a static figure would require many separate panels.

Plotly Express provides a concise interface:

import plotly.express as px

fig = px.scatter(
    penguins,
    x="bill_length_mm",
    y="bill_depth_mm",
    color="species",
    hover_data=["island", "sex", "body_mass_g"],
    title="Interactive comparison of penguin bill dimensions"
)
fig.update_layout(
    xaxis_title="Bill length (mm)",
    yaxis_title="Bill depth (mm)"
)
fig.show()

Interactivity should answer a user need. Hovering may reveal exact values without cluttering the chart, while filtering may support investigation by region or product. Animation is often overused; movement can distract from comparison and may create a misleading sense of continuity.

A dashboard framework such as Streamlit can combine controls, charts, tables, and explanatory text. A simple architecture separates data preparation, analytical calculations, visual components, and interface controls. This separation improves testing and reduces the risk that a user interaction changes a calculation unintentionally.

Interactive tools introduce additional responsibilities:

  • provide keyboard-accessible controls;
  • include a textual or tabular alternative;
  • make filter state visible;
  • show the time period and data refresh date;
  • prevent filters from producing an apparently complete but actually empty result;
  • preserve a clear default view;
  • ensure that tooltips do not contain the only explanation of a chart.

7. Accessibility and Inclusive Visualization

Accessibility is a quality requirement, not an optional enhancement. A visualization should remain interpretable when colour is unavailable, text is enlarged, a screen reader is used, or interaction is limited.

Practical measures include:

  • use sufficient contrast between text, marks, and background;
  • do not encode meaning with colour alone;
  • use direct labels or distinct line styles;
  • provide descriptive titles and captions;
  • use readable font sizes and avoid dense annotations;
  • provide alternative text or a data table for important findings;
  • ensure keyboard access to interactive controls;
  • avoid flashing or rapidly changing visual elements;
  • test with colour-vision simulation and screen-reader workflows where feasible.

Alternative text should communicate the purpose and main finding, not merely repeat the title. For example: “Line chart showing customer complaints declining from 42 in January to 19 in April after the service intervention.” A complex visualization may require a longer textual summary and an accessible underlying table.

8. Dashboards as Decision Systems

A dashboard is an interface for monitoring or investigating a defined set of measures. It is not simply a collection of charts. A useful dashboard identifies its audience, decisions, update frequency, data definitions, and escalation thresholds.

8.1 Dashboard structure

A decision-focused dashboard commonly includes:

  1. Context: title, scope, date range, and data freshness.
  2. Key performance indicators: a small number of measures directly related to objectives.
  3. Trend view: movement over time, not only the latest value.
  4. Diagnostic breakdown: dimensions that explain variation.
  5. Action area: alerts, recommendations, or links to investigation.
  6. Definitions and limitations: metric formulas, exclusions, and caveats.

A KPI should have a clear definition. For example, a conversion rate may be defined as:

Conversion rate = Number of completed conversions ÷ Number of eligible visitors × 100%

The numerator must be included in the denominator’s population and time period. If bots, repeat visitors, or cancelled transactions are excluded, those rules should be documented. A visually precise percentage is not meaningful if the metric definition is unstable.

8.2 Dashboard failure modes

Common failures include too many KPIs, decorative gauges, unexplained red–amber–green thresholds, inconsistent time periods, and charts that cannot be acted upon. A dashboard can also encourage gaming if users are rewarded for improving a metric without regard to quality or unintended consequences.

Before implementation, create a dashboard specification containing the audience, decision, metric definition, data source, refresh schedule, visual form, and action triggered by an exception. Stakeholder review should occur before extensive coding.

9. Analytical Narratives and Reports

Analytical communication should answer four questions:

  1. What happened?
  2. Why does it matter?
  3. How strong is the evidence?
  4. What should happen next?

A useful narrative structure is assertion–evidence–reasoning–action. The assertion states the finding. Evidence presents the relevant chart or statistic. Reasoning explains the relationship between evidence and conclusion. Action identifies a proportionate next step.

Titles can carry analytical meaning. “Delivery delays rose 18% after the supplier change” is more useful than “Delivery delays,” provided the calculation and comparison period are correct. An explanatory subtitle can state the population, time period, and data source.

Reports should distinguish:

  • observation from interpretation;
  • association from causation;
  • measured fact from forecast;
  • estimate from exact count;
  • statistical significance from practical importance;
  • confidence from certainty.

A decision-maker may need the absolute change, relative change, baseline, cost, risk, and uncertainty. Relative change is calculated as:

Relative change = (New value − Baseline value) ÷ Baseline value × 100%

The baseline must be stated. A rise from 2 to 3 is a 50% increase but only one unit in absolute terms. Both perspectives may be relevant.

10. Worked Example: From Raw Data to Decision

Suppose a retailer records weekly delivery performance before and after a logistics intervention. The analyst wishes to determine whether late deliveries declined sufficiently to justify continuing the intervention.

import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

orders = pd.DataFrame({
    "week": pd.date_range("2025-01-05", periods=8, freq="W"),
    "period": ["Before"] * 4 + ["After"] * 4,
    "late_rate": [0.120, 0.135, 0.110, 0.125, 0.090, 0.085, 0.095, 0.080],
    "orders": [1000, 980, 1020, 1010, 1005, 1030, 990, 1025]
})

fig, ax = plt.subplots(figsize=(8, 4.5))
sns.lineplot(data=orders, x="week", y="late_rate", marker="o", ax=ax)
ax.axvline(orders.loc[3, "week"], color="black", linestyle="--", alpha=0.6)
ax.set_ylabel("Late-delivery rate")
ax.set_xlabel("Week")
ax.set_title("Late-delivery rate declined after the intervention")
fig.autofmt_xdate()
fig.tight_layout()
plt.show()

The four-week mean before the intervention is:

(0.120 + 0.135 + 0.110 + 0.125) ÷ 4 = 0.1225

The four-week mean after the intervention is:

(0.090 + 0.085 + 0.095 + 0.080) ÷ 4 = 0.0875

The absolute reduction is 0.1225 − 0.0875 = 0.035, or 3.5 percentage points. The relative reduction is:

0.035 ÷ 0.1225 × 100% ≈ 28.6%

These calculations describe the observed periods; they do not by themselves prove that the intervention caused the improvement. Other factors, such as seasonal demand, staffing, or changes in order composition, may have contributed. The weighted rate across all orders may also differ from the simple mean of weekly rates. If each order is to receive equal weight, the preferred overall rate is:

Total late deliveries ÷ Total orders × 100%

The decision report should therefore include order counts, the exact metric definition, the observation period, possible confounders, and a recommendation such as continuing the intervention while monitoring a comparable control group.

11. Illustrative Case: Public Health Service Dashboard

Background

A regional public health agency monitors appointment access across clinics. Managers need to identify clinics where waiting times are increasing and determine whether staffing changes are required.

Problem

An initial dashboard displays twelve colourful gauges, but managers cannot tell which clinics are deteriorating, whether the change is recent, or how many patients are affected. The dashboard uses raw appointment counts, making large clinics appear consistently worse than small clinics.

Analysis

The data team defines three measures: median waiting time in days, the proportion of appointments completed within the target, and the number of patients waiting longer than the target. Each measure is linked to a decision. Median waiting time describes the typical patient experience; the target proportion supports service monitoring; the count identifies workload.

The team checks data freshness, duplicate appointments, cancellations, clinic capacity, and changes in reporting practice. Rates are compared with appropriate denominators, and confidence intervals are considered where sample sizes are small. The team avoids ranking clinics solely by a rate when a clinic has very few appointments.

Approach and solution

The redesigned dashboard begins with a date range and a data-refresh timestamp. It presents a KPI row, a time-series chart for the region, a sorted dot plot of clinic performance, and a table containing patient counts and definitions. A filter permits selection of clinic and service type. Colour indicates whether a target is met, but the exact value and target are also shown.

The narrative accompanying the dashboard states: “Waiting-time performance improved regionally over the last four weeks, but three clinics remain above the target for consecutive weeks. Two of these clinics serve high patient volumes and should be reviewed first.”

Outcome

Managers can identify both urgency and scale. They investigate staffing at the two high-volume clinics and use the third clinic as a comparison site. The dashboard is more useful because every visual element supports a monitoring or resource-allocation decision.

Learning points

  1. Metric definitions are part of visualization design.
  2. Rates and counts answer different questions.
  3. A dashboard should reveal trends, not only current status.
  4. Accessibility and textual explanation improve operational use.
  5. Visualization can support decisions without claiming more causal evidence than the data provide.

12. Ethics, Governance, and Limitations

Visualizations can mislead without containing a technically false statement. Selective time periods, truncated axes, omitted categories, inappropriate denominators, excessive decimal places, and unexplained missing data can all distort interpretation.

Analysts should preserve provenance: record the source, extraction date, transformation steps, filters, and version of the dataset. Reproducible notebooks or scripts should generate the final charts where practical. Metric changes must be communicated rather than silently applied.

Privacy is especially important in dashboards. Small cells, exact locations, and combinations of attributes can identify individuals even when names are removed. Suppression, aggregation, access controls, and disclosure review may be necessary. Sensitive attributes should not be exposed simply because a visualization library makes it easy to filter them.

Fairness should also be evaluated. Aggregate performance can conceal unequal outcomes across demographic or geographic groups. Disaggregating results may reveal disparities, but small samples can create unstable estimates and privacy risks. Ethical communication requires both transparency and care in interpretation.

AI-assisted visualization tools can generate charts, summaries, and code. They may accelerate work, but they can also select inappropriate chart types, invent interpretations, mishandle missing values, or produce confident prose unsupported by the data. Analysts remain responsible for validating calculations, chart scales, subgroup definitions, and narrative claims. AI output should be treated as a draft, not as evidence.

13. Contemporary Practice and Best Practices

Modern analytical environments increasingly combine notebooks, version-controlled code, semantic data layers, interactive dashboards, and automated data-quality checks. A mature workflow may include unit tests for metric calculations, snapshot tests for dashboard outputs, and review by subject-matter experts.

Recommended practice is to:

  • begin with the decision and audience;
  • inspect data quality before designing the chart;
  • use the simplest visual form that answers the question;
  • label units, denominators, time periods, and data sources;
  • show uncertainty and sample size where relevant;
  • use colour consistently and accessibly;
  • provide static and textual alternatives for interactive graphics;
  • distinguish descriptive findings from causal claims;
  • test the visualization with representative users;
  • document transformations and metric definitions;
  • review the final communication for privacy, fairness, and unintended interpretation.

A visualization is complete only when its audience can understand the evidence, assess its limitations, and connect it to an appropriate action.

Chapter Summary

Data visualization is both an analytical method and a communication practice. Exploratory graphics help analysts discover structure and errors, while explanatory graphics support decisions and accountability. Effective visualization begins with a question, a data structure, and an intended decision rather than with a favourite chart type.

Matplotlib provides precise control over static figures, and Seaborn provides convenient statistical graphics based on tidy data. Interactive tools such as Plotly and Streamlit support filtering, hovering, and drill-down, but they require accessible controls and non-interactive alternatives. Chart choice should reflect comparison, distribution, relationship, time, composition, or geographic purpose. Scale, colour, annotation, uncertainty, and denominators must be designed carefully.

Dashboards should be treated as decision systems with defined audiences, metrics, refresh schedules, and actions. Analytical reports should distinguish observation from interpretation and association from causation. Ethical practice requires truthful scales, transparent provenance, privacy protection, fairness analysis, and responsible use of AI-generated code or narratives.

Key Terms

Visualization: Representation of data through visual marks and encodings.

Exploratory visualization: A graphic used to investigate patterns, errors, and hypotheses.

Explanatory visualization: A graphic designed to communicate a selected finding.

Visual encoding: Mapping a data variable to position, length, colour, shape, or another visual attribute.

Tidy data: Data arranged so that each variable is a column and each observation is a row.

Histogram: A chart showing quantitative values grouped into intervals.

Box plot: A compact summary of distribution using quartiles, median, and potential outliers.

Scatter plot: A chart showing the relationship between two quantitative variables.

Small multiples: Repeated comparable charts divided by groups or categories.

Sequential palette: Colours representing ordered increasing or decreasing magnitude.

Diverging palette: Colours representing departures from a meaningful midpoint.

Confidence interval: An interval produced by an inferential method to express uncertainty about an estimated parameter.

Dashboard: An interface combining measures and visualizations for monitoring or investigation.

KPI: A key performance indicator linked to an organizational objective or decision.

Denominator: The reference population used when calculating a rate or proportion.

Data provenance: Documentation of a dataset’s source, transformations, and history.

Accessibility: Design that permits people with varied abilities and technologies to use and interpret a visualization.

Analytical narrative: Structured communication linking a finding, evidence, reasoning, and action.

Choropleth map: A map using area colour to represent a value associated with geographic regions.

Causal claim: A claim that a change in one factor produces a change in another, requiring appropriate evidence.

Review Questions

Short Answer Questions

  1. Distinguish exploratory visualization from explanatory visualization.
  2. Why is a bar chart usually preferable to a pie chart for precise category comparison?
  3. What is the difference between a standard deviation and a standard error?
  4. State two accessibility requirements for an interactive visualization.
  5. Why should a dashboard display both rates and counts in some applications?

Long Answer Questions

  1. Explain how data type, analytical purpose, and perceptual accuracy influence chart selection. Use at least three examples.
  2. Compare Matplotlib, Seaborn, and Plotly in terms of control, statistical graphics, and interactivity.
  3. Describe the design of a decision-focused dashboard, including metrics, trends, diagnostics, and action areas.
  4. Explain how misleading visualizations can be created without using factually false data. Discuss at least five mechanisms.
  5. Discuss how uncertainty, missing data, and causal limitations should be communicated in an analytical report.

Analytical / Application Questions

  1. A manager asks for a pie chart comparing ten product categories over three years. Recommend a more effective design and justify your choice.
  2. A clinic reports a fall in waiting-time rate from 12.25% to 8.75%. Calculate the absolute percentage-point reduction and relative reduction, then identify two reasons why the result may not establish causation.
  3. Design a dashboard specification for monitoring delivery performance. State the audience, decisions, metric definitions, visualizations, accessibility provisions, data-quality checks, and privacy risks.

Multiple Choice Questions with Answers

Question 1

Which visual encoding is generally most accurate for comparing quantitative values?

A. Position on a common scale

B. Area of circles

C. Colour saturation

D. Three-dimensional volume

Correct Answer: A. Position on a common scale

Question 2

Which chart is most directly suited to showing the distribution of one quantitative variable?

A. Pie chart

B. Histogram

C. Network diagram

D. Radar chart

Correct Answer: B. Histogram

Question 3

What does the formula SE(x̄) = s ÷ √n estimate?

A. The range of individual observations

B. The standard error of a sample mean

C. The population median

D. The percentage change between two means

Correct Answer: B. The standard error of a sample mean

Question 4

Which library provides a high-level interface for statistical graphics and integrates closely with Matplotlib?

A. Seaborn

B. NumPy

C. Requests

D. Openpyxl

Correct Answer: A. Seaborn

Question 5

Why should a bar chart normally use a zero baseline?

A. Because bar length represents magnitude

B. Because all charts require a zero baseline

C. To make categorical labels unnecessary

D. To convert counts into percentages

Correct Answer: A. Because bar length represents magnitude

Question 6

Which palette is most appropriate for values diverging around a meaningful midpoint such as zero?

A. Qualitative

B. Sequential

C. Diverging

D. Random

Correct Answer: C. Diverging

Question 7

What is a major purpose of an interactive tooltip?

A. To replace all chart labels

B. To reveal detail without permanently cluttering the chart

C. To hide the data source

D. To guarantee causal interpretation

Correct Answer: B. To reveal detail without permanently cluttering the chart

Question 8

Which statement best describes a decision-focused dashboard?

A. It contains as many charts as possible

B. It connects defined measures to monitoring or action

C. It uses gauges instead of all other charts

D. It excludes textual explanations

Correct Answer: B. It connects defined measures to monitoring or action

Question 9

A reduction from 0.1225 to 0.0875 is approximately what relative reduction?

A. 3.5%

B. 8.75%

C. 28.6%

D. 35.0%

Correct Answer: C. 28.6%

Question 10

Which practice improves accessibility?

A. Using colour as the only distinction

B. Removing all alternative text

C. Providing a textual or tabular alternative

D. Using smaller fonts to fit more data

Correct Answer: C. Providing a textual or tabular alternative

Python for Data Science
Chapter 10 of 15