How to fix marker size in scatterm in mapping toolbox

3 visualizzazioni (ultimi 30 giorni)
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?

Risposta accettata

Subhadeep Koley
Subhadeep Koley il 1 Nov 2019
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!

Più risposte (0)

Categorie

Scopri di più su Geographic Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by