How to plot a temperature colored map

9 ビュー (過去 30 日間)
Gab D
Gab D 2019 年 4 月 12 日
回答済み: sheshu kumar 2019 年 10 月 22 日
Hi everybody,
I have a matrix A=[x,y,temperature] with a lot of rows in each column. I would like to have a continuous colormap (preferably with the equipotential) of the temperature assign to each points. I am able to have the scatter with color, but it's difficult to see the evolution in space (see picture below). I have tried with surf, with contourf, but nothing seems to work (at least when I try with the other example I saw).
  3 件のコメント
Gab D
Gab D 2019 年 4 月 12 日
Hi,
I don't have much to show in terms of attempt, because nothing would give me something close to what I expected. I putted the variable I use in attachment file.
figure(1)
contourf(A)
surf(A)
darova
darova 2019 年 4 月 12 日
Look for griddata()

サインインしてコメントする。

採用された回答

KSSV
KSSV 2019 年 4 月 12 日
load('A.mat')
x = A(:,1) ;
y = A(:,2) ;
z = A(:,3) ;
nx = length(unique(x)) ;
ny = length(unique(y)) ;
X = reshape(x,nx,ny) ;
Y = reshape(y,nx,ny) ;
Z = reshape(z,nx,ny) ;
pcolor(X,Y,Z) ;
  1 件のコメント
Gab D
Gab D 2019 年 4 月 22 日
Thank you very much! This is perfect :)

サインインしてコメントする。

その他の回答 (1 件)

sheshu kumar
sheshu kumar 2019 年 10 月 22 日
load('A.mat')
x = A(:,1) ;
y = A(:,2) ;
z = A(:,3) ;
nx = length(unique(x)) ;
ny = length(unique(y)) ;
X = reshape(x,nx,ny) ;
Y = reshape(y,nx,ny) ;
Z = reshape(z,nx,ny) ;
pcolor(X,Y,Z) ;

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by