How to create a heatmap from recorded positions
조회 수: 4 (최근 30일)
이전 댓글 표시
Dear all,
Im trying to create a distribution map (or heatmap) from a table that represents ships positions (see figure).
Based on the previous figure, I would like to transform that into a heatmap. How can I do it.
Thanks in advance
댓글 수: 0
채택된 답변
Dave B
2021년 9월 8일
I'm not sure if you're asking about collapsing the trajectories to a single value per ship, or just displaying a binned version of the scatter? If it's the latter, binscatter (or histogram2) might solve this problem.
x=randn(1000,1);
y=x+randn(1000,1)/3;
nexttile;scatter(x,y,'.');title('scatter')
nexttile;binscatter(x,y);title('binscatter')
nexttile;histogram2(x,y,'DisplayStyle','tile');title('histogram2')
c=colorbar;
c.Label.String='Count';
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Distribution Plots에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!