How to fix marker size in scatterm in mapping toolbox

조회 수: 2 (최근 30일)
Poulomi Ganguli
Poulomi Ganguli 2019년 10월 29일
답변: Subhadeep Koley 2019년 11월 1일
Hello:
I want to show circles on the map using scatterm function. In that I want to fix size of each circles proportional to the magnitude. For example, magnitude corresponds to 100% or larger should appear as bigger circles and 50% will have the size the half of the previous case. They should also appear in the legend symbol. How should I fix the scales?

채택된 답변

Subhadeep Koley
Subhadeep Koley 2019년 11월 1일
Hi, according to the documentation, in scatterm(lat,lon,s,c) the area of each marker is determined by the magnitudes in the vector s.
Still if you are not able to use different size markers then use the code below, which travers through the vector sand plots different sizes of the marker based upon the given condition.
load seamount;
worldmap([-49 -47.5],[-150 -147.5])
for i=1:size(x,1)
if z(i)> (-850) % put your magnitude condition here
scatterm(y(i),x(i),5,z(i),'o','filled') % here markersize is 5
else
scatterm(y(i),x(i),50,z(i),'o','filled') % here markersize is 50
end
end
Hope this helps!

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by