on bleeding-edge matplotlib, backend is set when kwant is imported
Seen in the test failures here: https://gitlab.kwant-project.org/kwant/kwant/-/jobs/44176
and I managed to replicate on my machine.
This could be something unrelated to Kwant; I will investigate further