Python: Matplotlib avoid plotting gaps

Simply set the two values defining the line you don’t want to see as NaN (Not a Number). Matplotlib will hide the line between the two values automatically.

Check out this example :
http://matplotlib.org/examples/pylab_examples/nan_test.html

Leave a Comment