![](https://www.mathworks.com/matlabcentral/images/broken_image.png)
Problem with display an image along surface plot
1 次查看(过去 30 天)
显示 更早的评论
Hi everybody!
I have a problem with display an image along surface plot. Use this example https://www.mathworks.com/help/matlab/ref/surface.html
This is my original image
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/160095/image.png)
But, when use this script;
[X,map,alpha] = imread('original_imag.png');
%figure()
%imshow(X)
[x,y] = meshgrid(-1:0.1:1); % Generate x and y data
z = zeros(size(x, 1)); %
figure();
surface(x,y,z,double(X) + 1,...
'FaceColor','texturemap',...
'EdgeColor','none',...
'CDataMapping','direct');
The output is this wrong image;
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/160096/image.png)
Obviously, I have a problem with the palette of colors of the original image, but I can't be solved. Any solution?
Thanks in advance,
Nicolás
2 个评论
Jorge Mario Guerra González
2017-1-23
编辑:Image Analyst
2017-1-24
What is the outcome you expecting from the script?
Something like, with your image as texture?
![](https://www.mathworks.com/matlabcentral/images/broken_image.png)
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!