필터 지우기
필터 지우기

binning data and mapping

조회 수: 4 (최근 30일)
akk
akk 2019년 7월 24일
댓글: Bishwas Lal Shrestha 2020년 6월 23일
Hi,
I am trying to bin lat/lon data into 5x5 grids, and then plot the boxes. I have 3 columns: lat, long and temperature.
So far I have:
minlat=18.9980;
minlong=-96.5120;
gridspacing=5;
latidx = 1 + floor((lat_open - minlat) ./ gridspacing);
longidx = 1 + floor((long_open - minlong) ./ gridspacing);
num=accumarray( [latidx(:), longidx(:)], 1) %finds the # measurements in each grid
%Then I create the map
figure
m_proj('lambert','long',[-98 -81],'lat',[18 31])
m_gshhs_i('patch',[.7 .7 .7],'edgecolor','k')
grid on; hold on
m_grid('box','fancy','tickdir','in')
But, how do I get the coordinates of the grids and show them as boxes on the map? Thanks for your help!

답변 (1개)

Roshni Garnayak
Roshni Garnayak 2019년 8월 5일
You can use the binscatter function to create a binned scatter plot.
binscatter(latidx , longidx ,[5 5]);
A binned scatter plot partitions the data space into rectangular bins and displays the count of data points in each bin using different colors.
For examples and detailed explanation, refer to the following link:
  댓글 수: 3
akk
akk 2019년 8월 9일
Is there a way to call or index the data within a bin. For example, if I wanted to find all temperatures in bin 1?
Bishwas Lal Shrestha
Bishwas Lal Shrestha 2020년 6월 23일
I am trying to create a similar type of plot in mollweide projection. But I am not quite sure how we can use "binscatter" in map projection!

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

카테고리

Help CenterFile Exchange에서 Map Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by