I'm struggling to plot data over dateline when centred on the North Pacific using geoscatter.
17 次查看(过去 30 天)
显示 更早的评论
Below is some example data and code. I am wanting to use geoscatter to plot the data across the North Pacific, however it cuts off the data at the dateline (180W Figure 2) due to the way the figure is centered. Geobubble does not cut the data off in the same way and centers the plot around the data (the North Pacific see figure 1). How can I achieve this same behaviour seen in Geobubble (figure 1) in Geoscatter (figure 2)? Thanks for any help!
load example.mat
latlim = [30 75];
lonlim = [130 -115];
centre_lat=54.412;
centre_lon=-173.603;
figure
geobubble(tow_data(:,1),tow_data(:,2),tow_data(:,3));%HOW COME GEOBUBBLE ZOOMS IN BEAUTIFULLY??? Figure 1:
figure
geoscatter(tow_data(:,1),tow_data(:,2),50,tow_data(:,3),'filled');%GEOSCATTER doesn't do well going over -180 line : (
geolimits(latlim,lonlim);
colorbar %Figure 2:
0 个评论
采纳的回答
Kevin Holly
2023-6-7
编辑:Kevin Holly
2023-6-7
load example.mat
As you can see below, the data points are far apart.
figure
geoscatter(tow_data(:,1),tow_data(:,2),50,tow_data(:,3),'filled');
I added 360 degrees to all the datapoints that were negative.
figure
tow_data(tow_data(:,2)<0,2)=tow_data(tow_data(:,2)<0,2)+360;
geoscatter(tow_data(:,1),tow_data(:,2),50,tow_data(:,3),'filled');
colorbar
Alternatively, you could subtract 360 degrees from all of the longitudinal coordinates greater than zero.
figure
tow_data(tow_data(:,2)>0,2)=tow_data(tow_data(:,2)>0,2)-360;
geoscatter(tow_data(:,1),tow_data(:,2),50,tow_data(:,3),'filled');
colorbar
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Geographic Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!