Help to create a continuous surface heatmap

조회 수: 16 (최근 30일)
Sanley Guerrier
Sanley Guerrier 2024년 8월 19일
댓글: Voss 2024년 8월 19일
Dear experts -
I want to create a continuous 1D surface heatmap for every data point, with Distance (ft) in the X-direction and Temperature in the Y-direction. I have no idea how to do it. Please, can someone helps me with that.
Here I attached a sample of my data.
Thank you!
  댓글 수: 1
Sanley Guerrier
Sanley Guerrier 2024년 8월 19일
Maybe a colormap might work better if there is a difference between colormap and heat map.

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

채택된 답변

Voss
Voss 2024년 8월 19일
I'm not sure what a 1D surface looks like.
If Temperature is in the Y-direction, what variable should be used for the color of the surface?
Here I use all T0-T14 as the color data, Distance as X, and 1 through 15 as Y. Adjust as necessary.
data = readtable('data.xlsx','VariableNamingRule','preserve');
T = data{:,"T"+(0:14)};
X = data{:,"Distance (ft)"};
Y = 1:15;
surface(X,Y,T.')
axis tight
xlabel("Distance (ft)")
ylabel("1 - 15")
cb = colorbar();
cb.Label.String = "Temperature";
  댓글 수: 13
Sanley Guerrier
Sanley Guerrier 2024년 8월 19일
I set clim([-20 0]). Now it works :)
Thanks alot Voss.
Voss
Voss 2024년 8월 19일
Excellent!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Color and Styling에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by