Visualize population data in a coordinate grid

조회 수: 5 (최근 30일)
Bas
Bas 2016년 12월 7일
댓글: Star Strider 2016년 12월 8일
Hi,
I'm struggling with the imagesc function to plot my population data.
I have a matrix A of 1500 x 3, in which the first column contains the decimal degree latitude value, the second column contains the decimal degree longitude value and the third column contains the population count at that specific coordinate set.
Now I would like to make the population visible in a plot with the x-axis showing the longitude and the y-axis the latitude coordinate.
Matrix A looks like this:
A= [51.5416665650000 -0.650000374000000 236;
51.5416665650000 -0.641667041000000 519;
51.5416665650000 -0.633333708000000 1857............]

답변 (1개)

Star Strider
Star Strider 2016년 12월 7일
See if this does what you want:
A= [51.5416665650000 -0.650000374000000 236;
51.5416665650000 -0.641667041000000 519;
51.5416665650000 -0.633333708000000 1857];
figure(1)
scatter3(A(:,1), A(:,2), A(:,3))
grid on
figure(2)
stem3(A(:,1), A(:,2), A(:,3))
grid on
  댓글 수: 4
Bas
Bas 2016년 12월 8일
What I'm looking for is a 2D plot with on the x-axis the longitude coordinate, on the y-axis the latitude coordinate and the grid itself showing the population by means of a colorbar (darker color, a higher population density).
So the grid should be minimum longitude and latitude coordinate in the origin and the maximum longitude and latitude coordinate in the northeast corner.
Star Strider
Star Strider 2016년 12월 8일
Experiment with the image function and its friends:
figure(3)
image(A(:,1), A(:,2), A(:,3))
Note that the related pcolor function will delete one row and one column, because of the way it defines its plots. I do not recommend it for what you want to do.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by