Skip to content Skip to sidebar Skip to footer

Python: Matplotlib Avoid Plotting Gaps

I am currently generating the plot below: with this code: ax = plt.subplots() ax.plot(intra.to_pydatetime(), data) plt.title('Intraday Net Spillover') fig.autofmt_xdate() where i

Solution 1:

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

Post a Comment for "Python: Matplotlib Avoid Plotting Gaps"