Skip to content

Tutorials for Matplotlib import and TikZ diagrams - #84

Merged
max-models merged 1 commit into
develfrom
tutorials-import-diagrams
Nov 6, 2026
Merged

max-models merged 1 commit into
develfrom
tutorials-import-diagrams

Conversation

@max-models

@max-models max-models commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Covers the features the docs did not show yet.

Docs

  • Importing Matplotlib figures (tutorial_18_matplotlib_import.ipynb): Canvas.from_matplotlib on a two-panel figure, import_report, why Plotly refuses a native colour bar and how fallback="raster" helps, importing one Axes and drawing it as TikZ, strict=True and trusted=True.
  • TikZ diagrams (tutorial_19_tikz_diagrams.ipynb): canvas.add_tikzfigure() with nodes and paths; what the Matplotlib drawing shows (shapes, colours, text, lines), the diagram's own TikZ (arrow tips and all TikZ options), and which backends draw diagrams.
  • Plotly tutorial: a section on include_plotlyjs (bundled, "cdn", False, with the file sizes) and to_html(full_html=False) for embedding.

Fixes

  • A canvas with a add_tikzfigure panel crashed the Plotly backend with AttributeError: 'TikzFigure' object has no attribute '_secondary_xaxis_settings'. It now raises NotImplementedError, as the plotext backend already did; with a test.
  • The docs smoke test looked for tutorials/tutorial-07-tikz/1.png, which has failed on devel since 2 November. A notebook's outputs are numbered in order, and in CI the Plotly preview of tutorial 07 is 1.html, so the first compiled TikZ figure is 2.png (the CI build reports 6 assets for tutorial 07: one HTML and five images).

Checks

  • All four changed notebooks execute and convert with starlight-notebooks convert --strict; the site builds locally with the link check, and tutorials/tutorial-07-tikz/2.png is in dist.
  • 331 tests pass; the pre-commit hooks pass.

@max-models
max-models merged commit ca8e397 into devel Nov 6, 2026
49 of 55 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