plot heat map on map using Latitude, Longitude and my data value

조회 수: 59(최근 30일)
i have a number of locations across Europe (lat,lon), and for each one i have a corresponding value (in a form of a vector). I would like to create a heatmap using the mapping toolbox such that the a circle is drawn around each lat/lon, with the colour of these circles being defined based on the value my vector.
a simple example is as follows:
f=worldmap([33 68],[-15 37]);
geoshow('landareas.shp', 'FaceColor', [1 1 1],'DefaultEdgeColor', 'b')
PointLatLon = [51 -2.3;54 -3.2;50 3.9;51 5.5;48 1.1];
mValue = [1 4 2 7 3];
There is a code by Chad Greene which i can use to generate the circles (attached), but i don't know how to specify the colour in a heatmap form. the code for the circle can be found at:
Any help is much appreciated.

채택된 답변

Amy Haskins
Amy Haskins 2015년 12월 29일
편집: Amy Haskins 2015년 12월 29일
I think that scatterm will work nicely. It would look something like this:
markerSize = 50;
scatterm(PointLatLon(:,1), PointLatLon(:,2), markerSize, mValue,'Filled');
The colors will be chosen from the current colormap based on the value. You can use the colormap command or the figure's colormap editor to change the color coding scheme.
  댓글 수: 6
Poulomi Ganguli
Poulomi Ganguli 2018년 1월 12일
yea. Thanks! I tried something like that.. now its working :).

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

추가 답변(2개)

Arnab Sen
Arnab Sen 2015년 12월 29일
I understand that you would like to put color for the circles created on the map. You can do this by sending 'facecolor' as an argument to the 'circlem' function. For example, you may call the function with the arguments as following MATLAB code snippet:
>> h = circlem(lats(1),lons(1),500,'facecolor','red');
For complete documentation of 'circlem', refer to the following link:
  댓글 수: 1
Amir 2016년 1월 5일
Thanks Arnab, sending the 'facecolor' as an argument does color each circle, but i would like to color each one using the value of 'mValue' in a heatmap form.

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

Jack 2018년 1월 12일
Hi, this looks exactly what I need. However, is it possible to plot it on top of a google map? I am looking at data at much smaller spatial scales - towns and cities, rather than the world map in the example shown here.
Thank you
  댓글 수: 1
Poulomi Ganguli
Poulomi Ganguli 2018년 1월 16일
In that case, you have to read shapefile of your town/cities & repeat the above.

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


Find more on Data Distribution Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by