You can, of course, improve the interval by turning to a lower LaTeX level. To get started, at the top of your sites, do:
from matplotlib import rc rc('text', usetex=True)
Using a combination of \makebox and \hfill you can set spaces between two sections:
label=r"\makebox[4cm]{$t^2$ \hfill $0 \leq t \leq 1$}" label=r"\makebox[4cm]{$1$ \hfill $1 < t \leq 2$}" label=r"\makebox[4cm]{$3 - t$ \hfill $2 < t \leq 3$}"

Admittedly, this is not ideal, but with a combination of a few \makebox and \makebox you can fine-tune what you need. Ideally, you can write your own legend handler that βknowsβ the multi-line TeX block, but I'm sure this is not trivial.
source share