I am using matplotlib to scatter plot a 3D matrix of points. I am using the following code:
import pylab as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
my_data = np.random.rand(6500,3) # toy 3D points
fig = plt.figure()
ax = Axes3D(plt.gcf())
ax.scatter(my_data[:,0],my_data[:,1],my_data[:,2])
plt.show()
It works, so it opens a window where I can see my points.
However if I try to rotate the plot with the mouse (clicking and dragging it) it rotates REALLY slow.
I think 6500 points are not a lot for such a slow and laggy rotation, so I'm wondering if there is any pre-configuration to be done to speed it up.
Note: I tried to use Matlab and I can rotate a way bigger scatter plot without any lag, so it's not a computer limitation.
Can someone run this code and see if also experiences the slow rotation?
EDIT: Using the System monitor I can see that when rotating the points, only one CPU is used, so matplotlib is not parallelizing the process.
My computer specs:
- Intel(R) Core(TM) i5-3550 CPU @ 3.30GHz
- Graphic Card: Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller
- Memory: 10GB RAM
- HDD: Samsung SSD 500 GB
running Ubuntu 16.10