Description
When displaying any simple 3D plot, rotation by dragging with the mouse during a left-click no longer properly updates with the cursor's movement, other than at the very beginning. Using a right-click to zoom works as expected, however, updating the view throughout the cursor's movement.
This appears to happen with any 3D plot, so for a minimal example:
import matplotlib.pyplot as plt, mpl_toolkits.mplot3d
fig = plt.figure()
ax = fig.add_subplot(111, projection = '3d')
ax.scatter([1,0,0,0,0,-1], [0,1,0,0,-1,0], [0,0,1,-1,0,0])
plt.show()The problem appears to be that the image does not refresh during camera rotation movements, excluding at the very start. Thus, in order to see the result of a rotation, a new (and preferably small) rotation must be initiated. Alternately, a zoom action may be performed, as the view updates throughout the entirety of the zoom action.
While this bug is present in Matplotlib 2.0.2, it was not present in (at least some) versions prior to 2.0.0. Edit: This bug is only present with the MacOS backend, and was maybe not present in MacOS Mavericks version of that backend, while definitely being present in Sierra.
Edit Edit: This bug is present with Matplotlib 2.0.2 using the MacOS backend on MacOS Sierra, but was not present with at least some versions of Matplotlib just prior to 2.0.0 using the MacOS backend on MacOS X Mavericks.
Using default MacOS backends. Unsure if related to #8162.
Matplotlib version
- Operating System: MacOS 10.12.5
- Matplotlib Version: 2.0.2
- Python Version: 3.4.6
- Installed via MacPorts.
Activity
WeatherGod commentedon Jun 27, 2017
AlexanderLarsRobinson commentedon Jun 27, 2017
I can confirm that the problem does not extend to the Qt4Agg backend.
It is therefore likely that the upgrade which caused the issue on my end was not the upgrade of Matplotlib to 2.0, but rather the upgrade of MacOS from Mavericks to Sierra.
[-]3D plot camera-rotation does not update with mouse movement[/-][+]3D plot camera-rotation does not update with mouse movement when using the MacOS backend[/+]WeatherGod commentedon Jun 27, 2017
dstansby commentedon Jun 29, 2017
Can confirm this on OSX, using the macosx background, will try and bisect to find the cause.
dstansby commentedon Jun 29, 2017
Hmm, this bisects to c4614b4
Use figure.stale instead of canvas._needs_draw
tacaswell commentedon Oct 7, 2017
@dstansby Did this get fixed?
dstansby commentedon Oct 7, 2017
No, I'll put in a PR with the change that seems to fix it.
BUG: Set stale when rotating camera in Axes 3D (Fixes matplotlib#8814)