필터 지우기
필터 지우기

Making and colouring a vertical surface

조회 수: 30 (최근 30일)
Adam
Adam 2014년 8월 22일
댓글: Adam 2014년 8월 22일
Hi,
I'm trying to create and colour a vertical surface. I understand that 'patch' will simply create the plane, but I now need it coloured according to the data held within a variable. In essence, I want to do an upright version of the 'clown' example that is within the Matlab help for 'surface'. My thoughts are that I have to do something with surface rather than patch, but it beats me at the moment...
I've attached a figure of my isosurface, and the patch I now need coloured. Any tips would be much appreciated!
Thanks in advance

채택된 답변

Kelly Kearney
Kelly Kearney 2014년 8월 22일
You can do it pretty much exactly like the clown example; your surface just needs to define a vertical plane:
c = load('clown')
[x,z] = meshgrid(1:size(c.X,2), 1:size(c.X,1));
y = 50 * ones(size(x));
surf(x,y,z,c.X);
shading flat;
colormap(c.map);
  댓글 수: 1
Adam
Adam 2014년 8월 22일
That's excellent, thanks for the speedy advice.
I'll give it a whirl - must brush up on my skills with meshgrid!
Thanks again, Adam

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by