Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

4D heat map in matplotlib

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?

like image 788
jjv Avatar asked Oct 30 '22 12:10

jjv


1 Answers

Your data is of a slightly different form I imagine, but as long as you have a point for every thing you need to be plotted you could use something like they did here:

How to make a 4d plot using Python with matplotlib

like image 68
JB1 Avatar answered Nov 11 '22 06:11

JB1