Search code examples
3dmatplotlibpyqt4

How to enable rotation in an Axes3D (matplotlib) embedded in a PyQt4 widget?


I'm using the approach shown in the following questions for embedding an Axes3D in a PyQt4 widget:

Qt4 + mplot3d of matplotlib

When starting the application, I can not rotate the axes via mouse movement anymore. What do I need to do to enable the rotation again?


Solution

  • Any time you call something like Axes3D.clear(), then to enable mouse rotation again you have to call Axes3D.mouse_init().

    Seems to be undocumented, but it works for me! Source