Mapping toolbox: plotm strange behavior

1 vue (au cours des 30 derniers jours)
Marc Crapeau
Marc Crapeau le 30 Mai 2012
Hi,
I've just just experimented a strange behavior with the plotm function of the Mapping Toolbox (Matlab R2008b)
I'm on a simple world map,
figure;worldmap('w');
I try to plot some lines parallel to the equator using plotm (but the problem is the same with linem). Depending on their extend in longitude, the lines are plotted or not:
plotm([30 30],[-10 10],'-k') % plotted
plotm([30 30],[-80 80],'-k') % plotted
plotm([30 30],[-90 90],'-k') % not plotted !
plotm([30 30],[-180 -180],'-k') % not plotted !
plotm([30 30],[-10 0],'-k') % plotted !
plotm([30 30],[-90 0],'-k') % plotted !
plotm([30 30],[-180 0],'-k') % not plotted !
The deduction I made from these examples were: plotm try to plot the shorter path, and if the shorter path is not inside the projection, it doesn't work. Well. But I experiment this:
plotm([30 30],[-180 0],'-k') % not plotted, ok I understand
plotm([30 30],[-170 0],'-k') % plotted, ok, I see
plotm([30 30],[-171 0],'-k') % not plotted ! gne... oO ?
Do you know how to explain this ?

Réponses (1)

Rob Comer
Rob Comer le 31 Mai 2012
Try using the newer geoshow function instead of plotm. All the lines are displayed if I replace
plotm(lat,lon,'-k')
with
geoshow(lat,lon,'Color','k')
Even for your case number 4, which has identical endpoints,
geoshow([30 30],[-180 -180],'Color','k')
results in a visible object --- but you'll have to turn off the frame
framem off
and look carefully at the edge of the map to see it, because it's just a single point.

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by