Chapter-by-Chapter Teaching Notes

These notes provide teaching tips, common student struggles, suggested demos, and time allocation for each of the 35 chapters. Time allocations assume a 15-week semester with approximately 3 hours of class time per week.


Part I: Seeing Data --- The Science of Visual Perception

Chapter 1: Why Visualization Matters

Time allocation: 45 minutes lecture + 30 minutes activity

Teaching tips: - Open with Anscombe's Quartet --- have students compute summary statistics first, then reveal the plots. The surprise is the point. - Use the Datasaurus Dozen as a follow-up to reinforce that identical statistics can hide wildly different distributions. - Collect examples of good and bad charts from students' own fields to build relevance from day one.

Common struggles: Students who come from a pure coding background may be skeptical about "soft" design content. Ground everything in measurable outcomes: decision speed, error rates, recall accuracy.

Suggested demo: Show a dense table of numbers and ask students to find the outlier. Then show the same data as a scatter plot. Time both tasks.

Chapter 2: How the Eye Sees --- Visual Perception for Data

Time allocation: 60 minutes lecture + 30 minutes activity

Teaching tips: - Run live pop-out experiments: display grids of shapes where one differs in color, size, or orientation. Students experience pre-attentive processing firsthand. - Gestalt principles (proximity, similarity, continuity, closure, enclosure) are easier to teach with interactive exercises than with slides.

Common struggles: Students conflate "what looks nice" with "what the visual system processes efficiently." Redirect to research evidence. The distinction between pre-attentive and attentive processing is a threshold concept --- invest time here.

Suggested demo: Use matplotlib to create arrays of shapes demonstrating each Gestalt principle. Toggle groupings to show how proximity and similarity change perceived structure.

Chapter 3: Color --- Theory, Perception, and Accessible Palettes

Time allocation: 60 minutes lecture + 45 minutes lab

Teaching tips: - Demonstrate perceptual non-uniformity by converting a rainbow colormap to grayscale --- the banding artifacts are immediately visible. - Have students simulate color blindness on their own charts using online tools or the colorspacious library. - Assign the palette selection exercise early; students will reuse their chosen palettes throughout the course.

Common struggles: Color choice paralysis --- students become afraid to pick any palette after learning how many ways color can go wrong. Provide a short list of safe defaults (viridis, cividis, ColorBrewer qualitative palettes) as a starting point.

Suggested demo: Side-by-side comparison of a heatmap using jet/rainbow vs. viridis. Convert both to grayscale.

Chapter 4: Lies, Distortions, and Honest Charts

Time allocation: 45 minutes lecture + 30 minutes discussion

Teaching tips: - Bring real-world examples from news outlets. Students engage more with charts they have actually encountered. - Frame ethics as a professional obligation, not a philosophical abstraction. Connect to consequences: budget decisions, policy changes, public perception.

Common struggles: Some students believe that distortion is always intentional. Emphasize that most misleading charts result from ignorance of defaults (truncated axes, inappropriate scales) rather than malice.

Suggested demo: Take one dataset and produce five versions: honest, truncated y-axis, cherry-picked date range, 3D pie chart, dual-axis with mismatched scales. Ask students to rank them.

Chapter 5: Choosing the Right Chart

Time allocation: 45 minutes lecture + 45 minutes workshop

Teaching tips: - Walk through the chart chooser flowchart with multiple datasets, making the decision process explicit. - Give students datasets and have them propose chart types independently before revealing the "answer." There is often more than one defensible choice.

Common struggles: Students default to bar charts and line charts for everything. Push them to consider distributions (histograms, box plots), relationships (scatter), and composition (stacked area, treemap) when the data warrants it.

Suggested demo: One dataset, five chart types. Discuss which reveals the insight most effectively and why.


Part II: Design Principles --- From Data to Message

Chapter 6: Data-Ink Ratio and Visual Simplicity

Time allocation: 45 minutes lecture + 30 minutes exercise

Teaching tips: - Start with an extremely cluttered chart and have students identify every non-data element. Then remove elements one by one, discussing which removals improve clarity and which go too far. - Discuss the tension between minimalism and necessary context. A chart stripped to bare data-ink but missing axis labels is not an improvement.

Common struggles: Students interpret "remove chartjunk" as "remove everything." Teach them to distinguish decoration from information. Gridlines, for example, are sometimes chartjunk and sometimes essential for precise reading.

Suggested demo: Progressive decluttering of a real business chart. Save each stage. Display the sequence as a filmstrip.

Chapter 7: Typography and Annotation

Time allocation: 30 minutes lecture + 30 minutes workshop

Teaching tips: - Typography seems minor until you show a chart with 8pt unreadable axis labels next to one with proper hierarchy. The visual impact is immediate. - Teach the annotation hierarchy: title (the takeaway), subtitle (context), axis labels (what and units), callouts (specific data points), source (credibility).

Common struggles: Over-annotation. Students who learn annotation techniques sometimes label every data point. Teach restraint: annotate the insight, not the data.

Suggested demo: Take a bare matplotlib chart and annotate it live in class, narrating each decision.

Chapter 8: Layout, Composition, and Small Multiples

Time allocation: 45 minutes lecture + 30 minutes exercise

Teaching tips: - Small multiples are one of the most powerful and underused techniques. Show Edward Tufte's examples, then implement them in matplotlib using subplots. - Discuss alignment: why shared axes and consistent scales across panels are non-negotiable.

Common struggles: Students produce small multiples with inconsistent scales across panels, defeating the purpose. Emphasize shared axes and consistent color mapping from the start.

Suggested demo: A single cluttered chart with five categories, then the same data as five aligned small multiples.

Chapter 9: Storytelling with Data

Time allocation: 45 minutes lecture + 45 minutes activity

Teaching tips: - Have students outline a three-act structure (context, conflict, resolution) for a dataset before writing any code. - The narrative sequencing exercise --- arranging charts in order to build an argument --- works well as a group activity.

Common struggles: Students confuse "storytelling" with "decoration" or "persuasion." Storytelling is about structure and sequence, not about adding clip art or cherry-picking data.

Suggested demo: Present the same five charts in two different orders. Discuss how sequence changes the perceived message.


Part III: matplotlib --- The Foundation

Chapter 10: matplotlib Architecture --- Figure, Axes, Artists

Time allocation: 60 minutes lecture + 45 minutes lab

Teaching tips: - The object-oriented API is the most important concept in Part III. Students who master Figure/Axes/Artist think about visualization differently. - Draw the architecture diagram on the board: Figure contains Axes, Axes contains Artists. Refer back to this diagram throughout Parts III--IV.

Common struggles: Students mix pyplot stateful commands with object-oriented calls, producing confusing bugs. Enforce the object-oriented API from day one.

Suggested demo: Build the same chart using pyplot shortcuts and the OO API side by side. Show where the pyplot version breaks down (multi-panel figures, shared axes).

Chapter 11: Essential Chart Types in matplotlib

Time allocation: 45 minutes lecture + 45 minutes lab

Teaching tips: - Survey the big six: line, bar, scatter, histogram, box, area. For each, show the correct use case, a common misuse, and the relevant matplotlib call. - Connect every chart type back to Chapter 5 (chart selection) to reinforce the design-first approach.

Common struggles: Students call plt.bar() when they mean plt.hist() and vice versa. Clarify that bar charts are for categorical comparisons and histograms are for distributional shape.

Suggested demo: One dataset visualized six ways. Discuss which chart type answers which question.

Chapter 12: Customization Mastery --- Colors, Fonts, Styles

Time allocation: 45 minutes lecture + 45 minutes lab

Teaching tips: - Teach rcParams and style sheets as the primary customization mechanism, not per-call keyword arguments. Styles should be set once, not scattered across every plot call. - Have students create a personal style sheet that they will use for the rest of the course.

Common struggles: Students spend excessive time on per-element styling instead of defining a global style. Redirect to style sheets and rcParams dictionaries early.

Suggested demo: Apply three different style sheets to the same chart. Show how a single plt.style.use() call transforms the entire figure.

Chapter 13: Subplots, GridSpec, and Multi-Panel Figures

Time allocation: 45 minutes lecture + 45 minutes lab

Teaching tips: - Start with plt.subplots() for regular grids, then introduce GridSpec for irregular layouts. Do not introduce GridSpec until students are comfortable with regular subplots. - The constrained_layout vs. tight_layout distinction matters in practice. Demonstrate both and explain when each fails.

Common struggles: Overlapping labels and titles in multi-panel figures. Teach constrained_layout as the default and tight_layout as the fallback.

Suggested demo: Build the climate project multi-panel figure live, starting with a rough layout and progressively refining spacing, shared axes, and labels.

Chapter 14: Specialized matplotlib Charts

Time allocation: 30 minutes lecture + 30 minutes lab

Teaching tips: - Be selective. Not every student needs polar plots or 3D surfaces. Focus on the chart types relevant to your students' domains. - Emphasize that most specialized chart types are harder to read than their 2D equivalents. The bar for using a 3D chart should be high.

Common struggles: Students are drawn to 3D charts because they look impressive. Teach them to ask: "Does the third dimension encode data, or is it decoration?"

Suggested demo: A 3D surface plot vs. a 2D contour plot of the same data. Discuss readability.

Chapter 15: Animation and Interactivity in matplotlib

Time allocation: 30 minutes lecture + 30 minutes lab

Teaching tips: - FuncAnimation is conceptually simple but technically fiddly. Provide a working template and have students modify it rather than building from scratch. - Discuss when animation reveals temporal patterns vs. when it is gratuitous motion.

Common struggles: Saving animations requires ffmpeg or Pillow, which students may not have installed. Provide installation instructions in advance or use a shared computing environment.

Suggested demo: Animated time series of CO2 concentration over 150 years. Then discuss: is the animation more effective than a static line chart with annotations?


Part IV: Seaborn --- Statistical Visualization

Chapter 16: Seaborn Philosophy and the Grammar of Statistical Graphics

Time allocation: 30 minutes lecture + 30 minutes lab

Teaching tips: - Start by recreating a matplotlib chart in seaborn to show the reduction in code and the improvement in defaults. - Clearly distinguish figure-level functions (displot, catplot, relplot) from axes-level functions (histplot, barplot, scatterplot). This distinction causes the most confusion.

Common struggles: Students do not understand why fig, ax = plt.subplots() plus a seaborn axes-level function behaves differently from a seaborn figure-level function. Dedicate time to this.

Suggested demo: The same chart built three ways: raw matplotlib, seaborn axes-level, seaborn figure-level.

Chapter 17: Distributional Visualization

Time allocation: 45 minutes lecture + 30 minutes lab

Teaching tips: - Histograms vs. KDE vs. ECDF: teach when each is appropriate. KDE can be misleading for small samples or bounded data. ECDF avoids binning artifacts. - Have students compare violin plots, box plots, and strip plots on the same data.

Common struggles: Students set bin widths arbitrarily in histograms, producing wildly different impressions of the same data. Teach the impact of bin width with a live slider demo.

Suggested demo: One distribution displayed as histogram (three different bin widths), KDE, ECDF, violin, box, and strip plot.

Chapter 18: Relational and Categorical Visualization

Time allocation: 45 minutes lecture + 30 minutes lab

Teaching tips: - Emphasize the encoding channels available in seaborn relational plots: x, y, hue, size, style, row, col. Show how adding each channel reveals additional structure. - For categorical plots, compare bar, strip, swarm, box, and violin approaches.

Common struggles: Overloading a single chart with too many encodings. Teach the "one question per chart" principle: if you need five encodings, consider two charts instead.

Suggested demo: Start with a basic scatter plot and progressively add hue, size, style, and faceting, discussing the readability trade-off at each step.

Chapter 19: Multi-Variable Exploration

Time allocation: 30 minutes lecture + 30 minutes lab

Teaching tips: - Pair plots and heatmaps are powerful but can be overwhelming for high-dimensional data. Teach students to subset variables first. - The clustermap is useful but requires statistical context. Brief discussion of hierarchical clustering is helpful.

Common struggles: Students produce 20x20 pair plots that are unreadable. Teach them to select the 4--6 most relevant variables first.

Suggested demo: Pair plot of the corporate sales dataset with 5 variables, colored by region.


Part V: Interactive Visualization

Chapter 20: Plotly Express --- Fast Interactive Charts

Time allocation: 45 minutes lecture + 30 minutes lab

Teaching tips: - Plotly Express is the fastest path to interactive charts. Show how a single px.scatter() call produces hover, zoom, and pan. - Discuss the trade-off: interactivity adds exploration power but can also distract from a specific message.

Common struggles: Students treat interactivity as universally better than static charts. Reframe: interactivity is best for exploration; static charts are often better for communication.

Suggested demo: Convert a static matplotlib scatter plot to Plotly Express. Discuss what the interactivity adds and what it costs.

Chapter 21: Plotly Graph Objects --- Full Control

Time allocation: 45 minutes lecture + 30 minutes lab

Teaching tips: - Graph Objects is to Plotly Express what the OO API is to pyplot: more verbose but more powerful. Draw this analogy explicitly. - Focus on the trace/layout/figure mental model.

Common struggles: The deeply nested dictionary structure of Plotly Graph Objects frustrates students accustomed to matplotlib's method-chaining. Provide templates.

Suggested demo: Build a multi-trace chart with custom hover templates and annotations using Graph Objects.

Chapter 22: Altair --- Declarative Visualization

Time allocation: 30 minutes lecture + 30 minutes lab

Teaching tips: - Altair's grammar-of-graphics approach is conceptually elegant but unfamiliar. Spend time on the mark + encoding + selection model. - Compare Altair's declarative approach to Plotly's imperative approach on the same chart.

Common struggles: Altair's 5,000-row data limit surprises students. Teach the alt.data_transformers.enable('vegafusion') workaround or pre-aggregation strategies.

Suggested demo: Build an interactive linked brushing example in Altair --- it requires remarkably little code.

Chapter 23: Geospatial Visualization

Time allocation: 45 minutes lecture + 30 minutes lab

Teaching tips: - Geospatial visualization requires additional data types (GeoJSON, shapefiles) that may be new to students. Provide pre-processed files. - Choropleths are the workhorse. Focus most time here.

Common struggles: Coordinate reference system mismatches produce blank maps. Help students troubleshoot CRS issues systematically.

Suggested demo: Build a global temperature anomaly choropleth step by step: load the GeoJSON, merge with the climate data, render with Plotly or geopandas.

Chapter 24: Network and Graph Visualization

Time allocation: 30 minutes lecture + 30 minutes lab

Teaching tips: - Network visualization is easy to do poorly. The "hairball" problem is real. Emphasize filtering, layout algorithm selection, and knowing when a table or matrix is better. - NetworkX for computation, matplotlib or Plotly for rendering.

Common struggles: Students expect network layouts to be deterministic. Different runs produce different arrangements. Explain force-directed layouts and seed parameters.

Suggested demo: A small, clean network (10--15 nodes) vs. a large, unfiltered one (500+ nodes). Discuss readability.


Part VI: Specialized Domains

Chapter 25: Time-Series Visualization

Time allocation: 45 minutes lecture + 30 minutes lab

Teaching tips: - Time-series is the most common data type in industry. Invest adequate time here. - Teach rolling means, seasonal decomposition, and horizon charts as tools for revealing structure at different scales.

Common struggles: Date formatting and localization on axes. The matplotlib date system is notoriously tricky. Provide working code templates.

Suggested demo: The climate temperature anomaly time series with rolling mean overlays at 5-year, 10-year, and 30-year windows.

Chapter 26: Text and NLP Visualization

Time allocation: 30 minutes lecture + 30 minutes lab

Teaching tips: - Word clouds are popular but statistically weak. Teach them, then immediately show better alternatives (bar charts of term frequency, topic model heatmaps). - This chapter works well as a reading assignment with in-class discussion.

Common struggles: Students gravitate to word clouds as their only text visualization tool. Expand their repertoire.

Suggested demo: Side-by-side: word cloud vs. horizontal bar chart of the same term frequencies. Discuss which allows more precise comparison.

Chapter 27: Statistical and Scientific Visualization

Time allocation: 30 minutes lecture + 30 minutes lab

Teaching tips: - Focus on publication-quality figures: proper error bars, confidence interval shading, statistical annotations, and journal-compliant formatting. - If your students are researchers, this chapter is high-value. If they are business analysts, cover it lightly.

Common struggles: Incorrect error bar usage (standard error vs. standard deviation vs. confidence interval). Clarify the statistical meaning before the visualization technique.

Suggested demo: Build a publication-ready multi-panel figure suitable for a journal submission.

Chapter 28: Big Data Visualization

Time allocation: 30 minutes lecture + 30 minutes lab

Teaching tips: - The core insight is that you cannot plot every point when n exceeds ~10,000. Teach sampling, aggregation, density estimation, and datashader as strategies. - This chapter is more relevant for students working with real-world datasets.

Common struggles: Students are reluctant to sample or aggregate because it "loses information." Frame it as a necessary perceptual trade-off: a scatter plot with 1 million overlapping points hides more information than a properly binned hexbin plot.

Suggested demo: Scatter plot of the social media analytics dataset (200K rows) rendered naively vs. with hexbin vs. with datashader.


Part VII: Dashboards and Production

Chapter 29: Dashboards with Streamlit

Time allocation: 45 minutes lecture + 45 minutes lab

Teaching tips: - Live-code a dashboard from scratch in class. Streamlit's instant feedback loop makes it ideal for live demos. - Cover layout (columns, sidebar, tabs), widgets (slider, selectbox, multiselect), and caching.

Common struggles: Students build monolithic scripts instead of modular functions. Teach them to separate data loading, processing, and display logic.

Suggested demo: Build the climate dashboard in 45 minutes, starting from data loading and adding features incrementally.

Chapter 30: Dashboards with Dash

Time allocation: 30 minutes lecture + 30 minutes lab

Teaching tips: - Compare Dash's callback model to Streamlit's script-rerun model. Students should understand the trade-offs: Dash offers more control; Streamlit offers faster development. - If time is limited, this chapter can be assigned as reading.

Common struggles: Dash callbacks and the Input/Output/State model are conceptually more complex than Streamlit's linear script. Provide minimal working examples.

Suggested demo: The same mini-dashboard in Streamlit and Dash side by side. Compare code length and mental model.

Chapter 31: Automated Reporting

Time allocation: 30 minutes lecture + 30 minutes lab

Teaching tips: - Practical focus: generating PDF and HTML reports from Python scripts. Show the full pipeline from data to rendered document. - Libraries to cover: matplotlib savefig, reportlab, Jinja2 templates, weasyprint.

Common struggles: Rendering and dependency issues with PDF generation tools vary by operating system. Test the pipeline on your target environment before class.

Suggested demo: A script that loads the climate data, generates four figures, renders them into a styled PDF report, and saves it --- all in one execution.

Chapter 32: Theming, Branding, and Style Guides

Time allocation: 30 minutes lecture + 30 minutes workshop

Teaching tips: - Have students create a style guide document for a fictional organization: primary colors, font stack, chart templates, logo placement rules. - Connect to rcParams and custom style sheets from Chapter 12.

Common struggles: Students think theming is about making charts "pretty." Reframe as consistency and brand recognition --- the same reasons organizations have brand guidelines for print and web.

Suggested demo: Apply the same organizational theme across matplotlib, seaborn, and Plotly. Show the consistency.

Chapter 33: The Visualization Workflow --- From Question to Publication

Time allocation: 30 minutes lecture + 30 minutes discussion

Teaching tips: - This chapter synthesizes the entire course. Walk through the eight steps: question, data, sketch, encode, build, refine, critique, publish. - Have students map their capstone project plan to each step.

Common struggles: Students skip the sketch step and jump straight to code. Reinforce that 10 minutes of paper sketching saves hours of code iteration.

Suggested demo: Walk through the complete workflow for a novel dataset in real time, starting with a hand-drawn sketch and ending with a polished figure.


Chapter 34: Capstone --- A Complete Data Story

Time allocation: 90 minutes (presentation session)

Teaching tips: - Provide the capstone rubric (see Additional Assessments) at least three weeks before the due date. - Structure presentations: 7--10 minutes per student, followed by 3 minutes of audience feedback using a structured form.

Common struggles: Students underestimate the time needed for the capstone. Set intermediate deadlines: proposal (3 weeks out), data and initial charts (2 weeks out), draft (1 week out).

Suggested demo: Present your own capstone-quality example to set the standard.

Time allocation: 45 minutes discussion

Teaching tips: - Use this chapter as a gallery walk and retrospective. Print or project examples and have students identify which principles (from Parts I--II) each example follows or violates. - This is a good final class session: reflective, low-stress, and reinforcing.

Common struggles: None specific to this chapter. Use it as an opportunity to revisit struggles from earlier in the course.

Suggested demo: Curate a "best of" gallery from student work throughout the semester (with permission).