%% Display Image Along Surface Plot
% Create a surface and display an image along it.
% Create three matrices of the same size.

[pX,pY,pZ] = peaks(25);

%
% Load a data set containing an image of the Earth. The image data appears in a workspace variable X, and the associated colormap appears in map.

load earth
who

%
% Create a surface plot and display the image along the surface. Since the surface data pZ and the color data X have different sizes, set the surface FaceColor to 'texturemap'. Set the view of the plot to the default three-dimensional view.

surface(pX,pY,pZ,X,'FaceColor','texturemap', ...
    'EdgeColor','none','CDataMapping','direct')
colormap(map)
view(3)

% Copyright 2015 The MathWorks, Inc.