Dear all. I was exploring matplotlib’s 3d plot capabilities yesterday (and was pleasantly surprised, it looks good). Just to be clear, with
from mpl_toolkits.mplot3d import Axes3D
However, when I try to continuously redraw the plot with draw(), I get the error that draw() (for 3d plots) takes an additional argument aside from self. This argument is called renderer, and is not optional. Looking through the code for 3d axes, I couldn’t find a specification of what I should put as renderer.
Do you have any idea how I should work around this problem? Just to be clear, I can use draw() with normal plots (turning ion() on etc.), so my issue is only with Axes3D.
Basically, I want to mimick some code I already wrote in matlab, which draws a 3d plot and then updates it (with drawnow()).
EDIT: I realized that the renderer argument might be computer specific. I am sitting on a Windows with the Enthought installation of Python. If you need more information, let me know.
EDIT: I take it back. You can get it from
fig.canvas.renderer. I’ll leave the example below, though.There does not appear to be a documented way to get the renderer, but you can probably just peek within the axes structure at the _cachedRenderer. Note that you have to cause a plot to draw before this is set.
See the last line of this example: