I'm struggling to plot data over dateline when centred on the North Pacific using geoscatter.
16 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Clare Ostle
el 30 de Mayo de 2023
Comentada: Clare Ostle
el 8 de Jun. de 2023
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 comentarios
Respuesta aceptada
Kevin Holly
el 7 de Jun. de 2023
Editada: Kevin Holly
el 7 de Jun. de 2023
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
Más respuestas (0)
Ver también
Categorías
Más información sobre Geographic Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!