I'm (finally) getting started with matplotlib, and am enjoying the lovely plot quality. However, as a non-matlab user, I'm finding it *extremely* difficult to figure out how to do even the simplest tasks / understand the code samples. (e.g. what is the '111' in the boilerplate calls to add_subplot() in the various examples? I couldn't find anything in the docs, and had to resort to the matlab documentation!)
Anyhow, I've soldiered on, and have run across an issue that I don't know if is related to my non-comprehension of the right syntax, a bug in the Axes3D code, or a problem with the MacOSX backend. Here's code to duplicate the issue (Python 2.7, OS X 10.7, matplotlib 1.1.0, via pre-built installer):
import matplotlib as mpl
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.gca(projection='3d')
ax.plot([1,2,3], [2,3,2], [2,5,7]) # draws immediately!?
ax.cla() # plt.cla() has same effect
ax.plot([1,2,3], [2,3,2], [2,5,7]) # doesn't draw?
plt.draw() # now draws, but z-order is messed up -- grid lines on top?
# And worse, now figure can't be interactively rotated with the mouse
Nothing can restore interactivity short of making a new figure, or calling fig.clf() (which I *randomly* happened on), and then making a new set of axes.
Is this a known issue? Am I doing something wrong -- is ax.cla() or plt.cla() the wrong thing to clear the figure?
Thanks a lot,