Adding error bars in line figure with missing data <p>I want to draw lines between missing data as suggested <a href="https://stackoverflow.com/questions/14399689/matplotlib-drawing-lines-between-points-ignoring-missing-data">here</a> but with error bars.</p> <p>This is my code.</p> <pre><code>import matplotlib.pyplot as plt import numpy as np x = [1, 2, 3, 4, 5] y_value = [12, None, 18, None, 20] y_error = [1, None, 3, None, 2] fig = plt.figure() ax = fig.add_subplot(111) plt.axis([0, 6, 0, 25]) ax.plot(x, y_value, linestyle = '-', color = 'b', marker = 'o') ax.errorbar(x, y_value, yerr = y_error, linestyle = '' , color = 'b') plt.show() </code></pre> <p>But because of the missing data, I get </p> <blockquote> <p>TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType'</p> </blockquote> <p>What should I do?</p>