How to fix marker size in scatterm in mapping toolbox

2 vues (au cours des 30 derniers jours)
Poulomi Ganguli
Poulomi Ganguli le 29 Oct 2019
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?

Réponse acceptée

Subhadeep Koley
Subhadeep Koley le 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!

Plus de réponses (0)

Catégories

En savoir plus sur Geographic Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by