[Matplotlib-users] Matplotlib plots display as blank in interactive mode with no error messages - (one) Solution

FilipPersson filip at ownit.nu
Fri May 17 05:19:26 EDT 2019


I spent several hours googling and trying myself to change my code to fix
this. No luck in googling and the fact that there was a kind of doing brain
surgery on Matplotlib by uninstall, re-install and update and change backend
library for a similar but not quite the same problem made me think that I
should post the solution somewhere since it was almost impossible to spot.

If you get plots like this:
<http://matplotlib.1069221.n5.nabble.com/file/t5236/Blank_plot.png> 
Which, as you see gives no error output - not even when clicking on the
graph. Actually, nothing at all happens when clicking on the graph.
Interactivity is lost.

It could be a LaTeX problem causing it!
The reason for the blank plot was that I had used a LaTeX escape character
for the value 0 when creating nice labels for the x axis. Apparently, using
'$\0$' to write the number zero in LaTeX makes the plots blank and kills the
interactivity. Restarting the kernel did no good.
If I instead write '$0$' as a label, everything works fine again.

My environment is Mac OSX 10.13.6, Matplotlib 3.0.2, Python 3.7.1, running
in Jupyter (notebook server version 5.7.4, IPython 7.2.0) in Safari Version
12.0 (13606.2.11).

If you want to see my code, please request it and then I will post it.



--
Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html


More information about the Matplotlib-users mailing list