geoplotPlot a straight line between two points on a map. Specify the endpoints of the line using the coordinates of Seattle and Anchorage. Specify latitude and longitude in degrees.
latSeattle = 47.62; lonSeattle = -122.33; latAnchorage = 61.20; lonAnchorage = -149.9;
Plot the data on a map. Customize the appearance of the line using the line specification
'g-*'. Adjust the latitude and longitude limits of the map usinggeolimits.
geoplot([latSeattle latAnchorage],[lonSeattle lonAnchorage],'g-*') geolimits([45 62],[-149 -123]) fig2plotly()
Plot a straight line between two points on a map. Specify the endpoints of the line using the coordinates of Seattle and Anchorage. Specify latitude and longitude in degrees.
latSeattle = 47.62; lonSeattle = -122.33; latAnchorage = 61.20; lonAnchorage = -149.9;
Plot the data using
geoplot. Customize the appearance of the line using the line specification'g-*'. Adjust the latitude and longitude limits of the map usinggeolimits.
geoplot([latSeattle latAnchorage],[lonSeattle lonAnchorage],'g-*') geolimits([45 62],[-149 -123]) fig2plotly()
Identify Anchorage using the
textfunction.
text(latAnchorage,lonAnchorage,'Anchorage');
Identify Seattle using the
textfunction. Adjust the alignment of the text label by specifying properties of theTextobject.
text(latSeattle,lonSeattle,'Seattle',...
'HorizontalAlignment','right',...
'VerticalAlignment','bottom');
Specify the latitude and longitude coordinates of Seattle, Anchorage, and Point Barrow.
latSeattle = 47.62; lonSeattle = -122.33; latAnchorage = 61.20; lonAnchorage = -149.9; latPtBarrow = 71.38; lonPtBarrow = -156.47;
Plot straight lines from Seattle to each of the other two cities. Draw a solid yellow line from Seattle to Anchorage and a dotted blue line between Seattle and Point Barrow. Adjust the latitude and longitude limits of the map using
geolimits.
geoplot([latSeattle latAnchorage],[lonSeattle lonAnchorage],'y-',...
[latSeattle latPtBarrow],[lonSeattle lonPtBarrow],'b:')
geolimits([44 73],[-149 -123])
fig2plotly()
Label each city on the map using the
textfunction.
text(latAnchorage,lonAnchorage,'Anchorage');
text(latPtBarrow,lonPtBarrow,'Point Barrow');
text(latSeattle,lonSeattle,'Seattle',...
'VerticalAlignment','bottom');
Plot a straight line between two points on a map. Specify the endpoints of the line using the coordinates of Seattle and Anchorage. Specify latitude and longitude in degrees.
latSeattle = 47.62; lonSeattle = -122.33; latAnchorage = 61.20; lonAnchorage = -149.9;
Plot the data using
geoplot. Adjust the latitude and longitude limits of the map usinggeolimits. Customize the appearance of the line by specifying theLineWidthandColorproperties.
geoplot([latSeattle latAnchorage],[lonSeattle lonAnchorage],...
'LineWidth',2,'Color',[.6 0 0])
geolimits([45 62],[-149 -123])
fig2plotly()
Plot a straight line between two points on a map. Specify the endpoints of the line using the coordinates of Seattle and Anchorage. Specify latitude and longitude in degrees.
latSeattle = 47.62; lonSeattle = -122.33; latAnchorage = 61.20; lonAnchorage = -149.9;
Plot the data using
geoplot. Adjust the latitude and longitude limits of the map usinggeolimits.
geoplot([latSeattle latAnchorage],[lonSeattle lonAnchorage]) geolimits([45 62],[-149 -123]) fig2plotly()
Change the basemap used in the plot using the
geobasemapfunction.
geobasemap colorterrain