Skip to content

Tutorial plots in the course house style; Plotly and Kaleido removed - #44

Merged
beyondsimulations merged 2 commits into
mainfrom
tutorial-05-plots
Nov 11, 2026
Merged

beyondsimulations merged 2 commits into
mainfrom
tutorial-05-plots

Conversation

@beyondsimulations

@beyondsimulations beyondsimulations commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Why

  • Plotly and Kaleido: students run the tutorials in Zed, which shows plots only as images. The plotly() line in tutorial 05 hid them, and a callout told students to delete it. PlotlyBase and PlotlyKaleido (plus Kaleido_jll) were in the render environment only for that line.
  • House style: the tutorial plots used Plots.jl defaults with assorted colors. Introduction-to-Python's lecture 9 sets a house style for charts (its HOUSE settings). These tutorials now follow it, so both courses' plots look the same.

What

Commit 1: tutorial 05, Plotly and Kaleido

  • plotly() and its Zed callout are removed.
  • PlotlyBase and PlotlyKaleido are removed from applied-optimization/. Pkg.rm also dropped Kaleido_jll, Parameters and UnPack, and no other package changed version.
  • The production, stock and cost plots become stacked weekly bars with week numbers.
  • Costs are plotted in whole euros. With fractional values, a floating-point crumb below 0 made ylims=:round start the axis at −10k.

Commit 2: one shared style

  • include/plot_style.qmd defines course_style once:
    • brand colors in the same order as the Python course
    • quiet grey labels, no frame or tick marks, horizontal grid lines only
    • a bold title on the left
    • each plot call adds it with course_style..., so nothing is set globally
    • it is a visible cell, so it is also in the students' .jl files
  • Tutorial 05 uses the shared style.
  • 04-03: the production bars get units and rounded limits.
  • 07:
    • the route map has no grid and no frame, and its dots have a ring
    • the capacity bars get a quiet dashed capacity line instead of a red one
  • 11:
    • the seating grid (both copies) uses the brand colors and no grid
    • oxblood is kept for the violation cross alone, with a light halo so it shows on every seat color
  • 03-05: a short "Section 6 – The Course Look" teaches the four rules from the Python lecture (the title states the point, units on the axes, bars from 0, quiet everything else) and shows course_style on the example bar chart.

Checked

  • All plots viewed as the PNG Zed receives:
    • 05 from a full solve
    • 07 and 11 from the internal session solutions
    • 03-05 and 04-03 from their data
  • Palette: it passes the adjacent-pair colorblind check.
  • Renders: uv run quarto render succeeds for 03-05, 04-03, 05, 07 and 11.
  • Two /code-review high runs:
    • Fixed from them: the "k" tick formatter, the global default(), fixed limits that clipped wrong answers, a contrast problem with the violation cross, a misleading override example, a duplicate using Plots, and repeated hex values (now course_style.background_color and course_style.palette).
    • Left as is: a separate bar_style, merging tutorial 11's two visualize_seating copies (that duplicate was already there), and eval-only-when-needed for the include.

Not in this PR

  • The internal session solutions (05: plotly(), still works with a warning; 07, 11) keep their old plot code.
  • general/faq.qmd:52 still mentions plotly(). That advice is still true and is mirrored in Optimization-with-Julia.

Zed shows plots only as images, so plotly() just hid them. The line, its
Zed note and the now unused PlotlyBase/PlotlyKaleido (with Kaleido_jll)
are gone from the tutorial and the render environment.

The production, stock and cost plots become stacked weekly bars in the
house style of Introduction-to-Python's lecture 9: brand colors, quiet
labels, no frame, week numbers, units on the axes. One helper carries
the style per call instead of a global default().
course_style holds the house style of Introduction-to-Python's lecture
9 once; each plot call adds it with `course_style...`, so nothing is
set globally. Tutorial 05 now uses it, and 04-03 (production bars),
07 (route map and capacity bars) and 11 (seating grid, both copies)
are restyled with it: brand colors, quiet labels, no frame, units on
the axes, maps without grid, oxblood only for seating violations, a
quiet dashed capacity yardstick. Tutorial 03-05 gains a short section
that teaches the four rules behind it and shows course_style at work.
@beyondsimulations beyondsimulations changed the title Tutorial 05: house-style plots for Zed, Plotly and Kaleido removed Tutorial plots in the course house style; Plotly and Kaleido removed Nov 10, 2026
@beyondsimulations
beyondsimulations merged commit fe14c48 into main Nov 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant