I know that for a 4d color plot (3d surface, and the color is given by a 4th field), I can use a datafile of the format
# X Y Z C
1 1 0 4
1 2 1 3
2 1 4 2
2 2 4 5
...
and then use
set pm3d
splot "datafile.dat" u 1:2:3:4 with pm3d
On the other hand, I know how to make a simple surface plot where the X and Y values are implicit while the Z value is in matrix format:
#Z DATA ONLY
0 1
4 4
splot "datafile.dat" matrix
Is there a way to make 4d color plots using this matrix format? For example, taking the Z data from one file and the corresponding color data from another file, or combining both the Z value and the color into a single file in matrix format?

