How can I plot a colormap with user-defined color scale and x-y value in longitude-latitude?

조회 수: 2 (최근 30일)
I have to create a 2D TEC (Total Electron Content) Map like this: TEC Map Example (refresh again if you can't see)
I got data like this: (latitude, longitude, corresponding TEC value) for latitude from 80N to 80S and longitude from 180E to 180W (with interval: every 1 degree longitude and every 1 degree latitude)
What function should I use?
I tried the pcolor function but the result is not like the example above. It seems to be not smooth and the TEC value is not represented by a color grid (1*1 degree) but the intersection of x-y axes. One row and column data were missing on the map too.
I also want to define specific color scale for the map and set upper and lower limit (a specific color scale for TEC value 0 to 30)
How can I solve this problem? Thank!!!!!!
  댓글 수: 1
Busra
Busra 2016년 1월 20일
I'm looking for solutions to these problems. Have you been able to solve? if you are able to solve can you give more details?

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

채택된 답변

Chad Greene
Chad Greene 2015년 2월 3일
pcolor does throw a way a row and column of data, and offsets it by half a pixel. But if you use shading interp, you'll get the smoothness that you want and it won't be offset. Use imagesc if you don't want to get rid of all your data, or use pcolor like this:
pcolor(lon,lat,TEC)
shading interp % <- smooths the shading
caxis([0 30]) % <- sets color axis
To make it more map-like, if you have the mapping toolbox you'll be able to plot coastlines easily. Or you can search the internet for M_map, which is a free alternative to Matlab's Mapping Toolbox.
  댓글 수: 2
SO
SO 2015년 2월 5일
Thank for your reply.
I tried your suggestion but the color map (attached) is not smooth enough. You can clearly see some 'edge' at the point of color (value) changing.
The data I used is 161 row * 361 column
Chad Greene
Chad Greene 2015년 2월 5일
An argument could be made that the pixelated display is good, because it accurately represents the resolution of the underlying data. But, if you want smoother display, you could try bicubic interpolation to 0.1 degree resolution with interp2.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Geographic Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by