how to plot multiple geoscatter plots together

50 views (last 30 days)
Hello, I'm trying to plot two sets of scatter points with geoscatter, but the second set just overrides the first. I've tried using geoaxes, but it doesn't work. Does anyone know how to solve this problem?
% Plot map

Accepted Answer

Payas Bahade
Payas Bahade on 26 May 2020
Hi Jing,
You can use ‘hold on’ after plotting the initial sets of scatter points with ‘geoscatter’ to add next set of points to existing plotted points. Below mentioned code illustrates use of ‘hold on’ :
%Set up latitude and longitude data.
lon = (-170:10:170);
lat1 = 50 * cosd(3*lon);
lat2 = 20 * cosd(3*lon);
%Define data that controls the area of each marker.
A = 101 + 100*(sind(2*lon));
%Define data to control the color of each marker.
C = cosd(4*lon);
%Plotting first set of points
%Using hold to retain plotted points
hold on
%Plotting second set of points
Kindly refer this documentation link to know more details on using ‘hold’ command.
Hope this helps!
Caglar Temiz
Caglar Temiz on 6 Jun 2021
Edited: Caglar Temiz on 6 Jun 2021
Does the 'hold on' comment work only the same longitude (or latitude)?

Sign in to comment.

More Answers (0)


Find more on Geographic 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!