I have a 4D plot plotted using matplotlib with the 4th dimension being color.
Lets assume the range of all the 3 axes to be 0 to 5. Array for plot looks something like this - [0,1,2,50],[1,2,3,40],[5,5,5,80]. So I will see 3 points on co-ordinates [0,1,2],[1,2,3],[5,5,5] in the graph when plotted (assuming a scatter plot).
My question is - is there any way to check the combinations of co-ordinates on the plot which do not have any points. In the above case, for example, there are no points on co-ordinates [1,2,4],[1,2,5],[0,0,0],[1,1,1],[4,1,2],[5,3,1] and so on. I can individually check if there is an element (between 0 and 5) which is not covered in a particular axis (using 'is in'). But how to get the missing combination of co-ordinates and then plot it in the graph with some dummy value ? Any leads or solution would be appreciated.
#create an empty list
list1 = []
#append elements to the list
list1.append([0,1,2,50])
list1.append([1,2,3,40])
list1.append([5,5,5,80])
using the scatter plot
cmap = LinearSegmentedColormap.from_list('mycmap', ['green', 'yellow', 'red'])
fig = plt.figure()
ax = fig.gca(projection = '3d')
ax.set_xlim(0,5)
ax.set_ylim(0,5)
ax.set_zlim(0,5)
#convert list into array for slicing
array1 = np.array(list1)
ax.scatter(array1[:,0],array1[:,1],array1[:,2],c=array1[:,3], cmap = cmap)
plt.show()
for the above i need to add zeroes to remaining co-ordinates. When i plot, the co-ordinates (0,1,2) gets a color corresponding to 50, (1,2,3) gets a color corresponding to 40 and similarly for co-ordinates (5,5,5). So the remaining co-ordinates should be appended with zeroes. Like (1,4,1,0), (1,3,5,0), (2,4,1,0) and so on.