color map in 3d plot, based only on the values of the z-axis?

조회 수: 2 (최근 30일)
Erez
Erez 2018년 10월 21일
편집: jonas 2018년 10월 21일

I have a 3-dimensional plot of a curve, based on:

     xx=0:9; yy=[-5:0 -1:-1:-4]; zz=[1:5 4:-1:0]; 
     plot3(xx,yy,zz,'-o'); 

I wish to add a surface underneath this curve, with a color map that represents the height of the curve along the z-axis. Namely, I wish that the surface will be more blue when z is small, and more red when z is high.

How do I do that? I use Matlab 2014b (unfortunately)...

Thanks!

  댓글 수: 1
jonas
jonas 2018년 10월 21일
편집: jonas 2018년 10월 21일
That is the entire point of a surface (i.e. surf() plot). You could also use pcolor if you wish the surface to be in 2d.
Upload some data if you need code.

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

답변 (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