How to make a scatter plot of a 2D field in a map and add contour lines of a different field in the same map, without the contour command messing up with the color scale of the scatter command?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Afonso Paiva
el 21 de Sept. de 2019
Respondida: darova
el 21 de Sept. de 2019
Say T is a vector with temperatures at specific longitudes(lon) and latitutes (lat) in a certain area.
Batim is a 2D depth field for the same area - say batim(i,j).
The command scatter(lon,lat,50,T,'filled') works fine, and shows dots with different colors (different temperatures) distributed in the domain. But if I add contour(i,j,batim,[100 1000])) or contour(i,j,batim,[100 1000]),'k'), then the T dots will be plot all with the same color.
2 comentarios
Respuesta aceptada
darova
el 21 de Sept. de 2019
Max value of batim is 1000, so MATLAB automaticaly rescale color range for [0 1000]
try
set(gca,'Clim',[0 30])
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Contour Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!