I want to plot a 4D heatmap in Python through matplotlib, like this 4d map.
I have already a set of 3D grid points (x,y,z)
and its corresponding function value f
.
I am thinking of plotting it using plot_surface
with x
, y
, z
as the three required arrays, and alter the color gradient using f
.
There is a way here to use f
for the color gradient, but I have trouble plotting the 3D grid, which I will emphasize that the third dimension is independent of the first two. (The second link shows otherwise.)
Or are there any way to better visualize this 4D data using matplotlib?
plt.show()
) where I can see all the sides of the cube. With this, it would be cumbersome to plot 6 heatmaps with custom grid arrays and checking the indices off
for each plane. – Brotherton