I'm looking to graph a 4D data set (X, Y, Z, intensity) using opacity to represent intensity. I also want the color to be dependent on the Z variable as well to better show depth.
Here is the relevant code so far, I am a novice when it comes to Python:
.
.
.
x_list #list of x values as floats
y_list #list of y values as floats
z_list #list of z values as floats
i_list #list of intensity values as floats
.
.
.
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
Axes3D.scatter(ax, x_list, y_list, z_list)
.
.
.
So how can I do this?
I'm thinking the color could be a linear relationship between z_list and a color map (hsv for example), and opacity could be linear as well, i_list/max(i_list) or something along those lines.
I would do something like the following:
Here's an example with
x_list = y_list = z_list = i_list
. You can choose any of the colormaps here or make your own: