Skip to content

Conversation

@lucasb-eyer
Copy link
Contributor

This is only the exporting. I'll make a PR with the rendering-side of this tomorrow, but ideally we just merge this one as it's trivial :)

lucasb-eyer added a commit to lucasb-eyer/mpld3 that referenced this pull request Jan 20, 2026
This adds or fixes support for the following matplotlib axis title
(ax.set_title) features:
- newlines: SVG `<text>` can't do that, need to use `<tspan>`s inside,
  see also [this SO q/a](https://stackoverflow.com/questions/16701522/how-to-linebreak-an-svg-text-within-javascript).
- linespacing: naturally follows from wanting newlines. Needs exporter
  support, so PR mpld3/mplexporter#77 first.
- left/right titles were completely missing; this adds support for
  those, which also needs exporter support, so this PR first:
  mpld3/mplexporter#78
- The `malign` property, which defines in the multi-line case, how the
  text lines should be aligned (all left, all center, all right).

I made this with major help from gpt-codex-5.2, although in the end I
went over all of its code and did a little simplifications here and
there, needed multiple iterations overall.
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