Matplotlib says fig.canvas is None, so I can't use fig.canvas.draw
问题 I haven't used Matplotlib much. Based on someone's advice, I'm trying to write some plotting codes using object-oriented paradigms as much as possible---and therefore trying to use pure Matplotlib (i.e. not relying on pyplot) to generate some simple figures. A stripped-down version of my code looks like this: import matplotlib as mpl time = [0,1,2,3,4] cell = [1,2,1,2,1] sample = [3,2,3,4,4] (figHt, figWd) = (5, 8) # in lBorderWidth = bBorderWidth = rBorderWidth = tBorderWidth = 0.1 lbwh =