Effacer les filtres
Effacer les filtres

How to plot a temperature colored map

19 vues (au cours des 30 derniers jours)
Gab D
Gab D le 12 Avr 2019
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 commentaires
Gab D
Gab D le 12 Avr 2019
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 le 12 Avr 2019
Look for griddata()

Connectez-vous pour commenter.

Réponse acceptée

KSSV
KSSV le 12 Avr 2019
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 commentaire
Gab D
Gab D le 22 Avr 2019
Thank you very much! This is perfect :)

Connectez-vous pour commenter.

Plus de réponses (1)

sheshu kumar
sheshu kumar le 22 Oct 2019
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) ;

Catégories

En savoir plus sur Geographic Plots dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by