Plotting the density of latitude and longitude points as a heat map on geographic data

8 ビュー (過去 30 日間)
Alex Lojko
Alex Lojko 2017 年 11 月 23 日
移動済み: Dyuman Joshi 2023 年 10 月 2 日
Hello, I have tried posting this elsewhere with no luck.
In continuation with my project for plotting lightning over the territory of Poland, I would like to plot the density of latitude and longitude points. So, areas which have more latitude & longitude points over the territory will have a different colour to areas with less latitude & longitude points. Currently I am able to plot latitude and longitude on a map; however, I would like the plots to have different colours depending on their density on this map:
https://imgur.com/a/OqcGq
I have tried many approaches but I have not found anything that works for my case.
I have tried creating a heatmap of points using the hist3 command; whilst this creates a heatmat with respect to density of points. It is a square grid and I cannot transpose this onto my map. I also tried downloading some functions from mathsworks such as this one: https://uk.mathworks.com/matlabcentral/fileexchange/8577-scatplot This is the closest I have gotten to somewhat plotting what I want: https://imgur.com/a/hn9uc using the command: scatplot(perun10_16.longitude, perun10_16.latitude, 'circles') Unfortunately, I do not know of a way to transfer this graph as spatial data onto my map of Poland using command: h = worldmap([48 57], [13 26]) % S = shaperead('POL_adm0.shp', 'UseGeoCoords', true); geoshow(h, S, 'Facecolor',[0.5 0.8 0.7])
% hold on
scatplot(perun10_16.latitude, perun10_16.longitude, 'circles')
% perun10_16.latitude and longitude represents the month of october, 2016.
I am aware that simply slapping on the scatplot function onto my map is not enough to get my idea working. If there was also a way to import a polygon outline of the map of Poland onto the figure I have created, that would also be acceptable; however, I am not sure how to do that either.
I hope this is enough information to know what I am doing. Does anyone have any suggestions as to what I should try now?
  2 件のコメント
Joel Kuyper
Joel Kuyper 2020 年 1 月 9 日
移動済み: Dyuman Joshi 2023 年 10 月 2 日
I am curious whether or not you already fixed this.
j.d.kuyper@student.tudelft.nl
Rui
Rui 2022 年 9 月 9 日
Hi,
try surfacem using the output from hist3. It should work just fine!

サインインしてコメントする。

回答 (1 件)

Sean de Wolski
Sean de Wolski 2020 年 1 月 9 日
Look at geodensityplot
https://www.mathworks.com/help/releases/R2019b/matlab/ref/geodensityplot.html

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by