how to plot contour of matrix?

3 visualizaciones (últimos 30 días)
Lilya
Lilya el 24 de Dic. de 2018
Comentada: Lilya el 24 de Dic. de 2018
Hi all..
the attached plot is showing the time vs. latitude for the sea surface temperature (SST) anomalies (see attachment anom_04).
i wanted to do the same using contour plot but the sizes of the resulted matrices (mishgridded) are giving me errors.
the data sets are:
anomalies of SST 458*289*8
time = 2004 4 3
2004 4 11
2004 4 19
2004 4 27
2004 5 5
2004 5 13
2004 5 21
2004 5 29
latitude = 458*1
Thanks for the help.
  4 comentarios
KSSV
KSSV el 24 de Dic. de 2018
YOu don't have time here...you have (lat,lon) and the data. What you want to plot from here?
Lilya
Lilya el 24 de Dic. de 2018
sorry again.. I attaced it..
i want to plot the latitude in y-axis, time in x-axis and the anomalies in z-axis (the contour data)
thanks once again for the help sir KSSV

Iniciar sesión para comentar.

Respuesta aceptada

KSSV
KSSV el 24 de Dic. de 2018
load('latlonmodis.mat') ;
load('anom_04.mat') ;
load('mtime.mat')
x = longitude ;
y = latitude ;
t = mtime ;
A = anom_04 ;
B = squeeze(nanmean(A,2)) ;
B = B-nanmean(B) ;
d = datetime(datestr(t)) ;
contourf(datenum(d),y,B) ;
datetick('x', 'dd-mm-yyyy','keepticks')
  1 comentario
Lilya
Lilya el 24 de Dic. de 2018
Thank u so so so so much!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Contour Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by