I have used two input arrays with an output array that I have interpolated with numpy's LinearNDInterpolator and scipy's ndimage filters. I was able to easily visualize the output using a matplotlib's pcolormesh. I would like to extend this analysis to 3 input arrays using the same ndimage and interpolation functions, but am not sure how to visualize the data. My best guess as to a solution would be to scatter the data using a solution similar to How to make a 4d plot with matplotlib using arbitrary data but more steps are needed as my output is a grid.
Here is the skeleton:
from scipy.interpolate import LinearNDInterpolator
dat_A = np.sin(np.arange(200))
dat_B = np.cos(np.arange(200))
dat_C = np.sinh(np.arange(200)/200)
output = dat_A + dat_B - 2*dat_C
A,B,C = np.arange(200),np.arange(200),np.linspace(0,2,200)
A_grid,B_grid,C_grid = np.meshgrid(A,B,C)
interp = LinearNDInterpolator(list(zip(dat_A,dat_B,dat_C)),output)
4D_out = interp(A_grid,B_grid,C_grid)
How do I visualize this 4D object? I was thinking animating through a 3D plot.