I have four dimensional data (x, y, z displacements; and respective voltages) which I wish to plot in a 3d scatterplot in python. I've gotten the 3d plot to render, but I want to have the colour of the points change using a colourmap, dependent upon the magnitude of the point's voltage.
I've tried a few things, but can't seem to get it to work I'm getting the error ValueError: Cannot convert argument type <type 'numpy.ndarray'> to rgba array
. I'm not sure exactly how to convert what I need to convert, so if anybody could please offer some help, I'd be most appreciative.
My code is here:
fig = plt.figure()
from mpl_toolkits.mplot3d import Axes3D
cmhot = plt.cm.get_cmap("hot")
ax = fig.add_subplot(111, projection='3d',)
ax.scatter(x, y, z, v, s=50, c = cmhot)
plt.show()