I have a list of tuples in python containing 3-bit data, where each tuple has the form: (x, y, z, data_value), i.e. I have data values ββfor each (x, y, z) coordinates. I would like to make a 3D discrete graph of a heatmap where colors represent the value of data_values ββin my list of tuples. Here I will give an example of such a heat map for a 2D data set, where I have a list of (x, y, data_value) tuples:
import matplotlib.pyplot as plt from matplotlib import colors import numpy as np from random import randint
This creates a graph like this: 
How to make a similar plot in three-dimensional space (i.e. with the z axis) if my data has a third dimension. For example, if
# x and y and z coordinates x = np.array(range(10)) y = np.array(range(10,15)) z = np.array(range(15,20)) data = np.zeros((len(y),len(x), len(y)))
It seems to me that plot_surface in mplot3d should be able to do this, but the z at the input of this function is essentially the data value in (x, y), i.e. (x, y, z = data_value), which is different from what I have, i.e. (x, y, z, data_value).