figure;

a = rand (10, 10, 10);

[x, y, z] = meshgrid (1:10, 1:10, 1:10);

s1 = surface (squeeze (x(6,:,:)), squeeze (y(6,:,:)), squeeze (z(6,:,:)), squeeze (a(6,:,:))); view (3); hold on
set (s1, "FaceColor", "texturemap");
## This surface at y = 6 is not displayed correctly (only one color)


s2 = surface (squeeze (x(4,:,:)), squeeze (y(4,:,:)), squeeze (z(4,:,:)), squeeze (a(4,:,:)));
set (s2, "FaceColor", "texturemap");
## This surface at y = 4 is displayed correctly (different colors)

s3 = surface (squeeze (x(2,:,:)), squeeze (y(2,:,:)), squeeze (z(2,:,:)), squeeze (a(2,:,:)));
set (s3, "FaceColor", "texturemap");
## This surface at y = 2 is displayed correctly (different colors)


set (s1, "FaceColor", "flat");
## Now, this surface at y = 6 is displayed correctly (different colors). But the surface at y = 4 is not

set (s2, "FaceColor", "flat");
## Now, this surface at y = 4 is displayed correctly (different colors). But the surface at y = 2 is not

set (s1, "FaceColor", "texturemap");
## Now, the surface at y = 2 is displayed correctly (different colors). But this surface at y = 6 is not
