Arabia¶
In [1]:
Copied!
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
# Set the latitudinal and longitudinal limits of the map.
minLat, maxLat = 12.0, 32.0
minLon, maxLon = 30.0, 60.0
# Create a figure and axes object.
fig = plt.figure(figsize=(8, 8))
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8])
# Create a Basemap object with the specified projection and limits.
m = Basemap(
projection='cyl',
resolution='h',
llcrnrlat=minLat,
urcrnrlat=maxLat,
llcrnrlon=minLon,
urcrnrlon=maxLon,
ax=ax
)
# Draw the blue marble background.
m.bluemarble()
# Add the coastline and country boundaries.
m.drawcoastlines(color='k')
m.drawcountries(color='k')
# Add the parallels and meridians.
parallels = range(int(minLat), int(maxLat)+1, 4)
meridians = range(int(minLon), int(maxLon)+1, 6)
m.drawparallels(
parallels,
labels=[1, 0, 0, 0],
fontsize=14,
linewidth=0.5
)
m.drawmeridians(
meridians,
labels=[0, 0, 0, 1],
fontsize=14,
linewidth=0.5
)
# Set the title of the plot.
plt.title('Map of Arabia', fontsize=20)
# Display the plot.
plt.show()
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
# Set the latitudinal and longitudinal limits of the map.
minLat, maxLat = 12.0, 32.0
minLon, maxLon = 30.0, 60.0
# Create a figure and axes object.
fig = plt.figure(figsize=(8, 8))
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8])
# Create a Basemap object with the specified projection and limits.
m = Basemap(
projection='cyl',
resolution='h',
llcrnrlat=minLat,
urcrnrlat=maxLat,
llcrnrlon=minLon,
urcrnrlon=maxLon,
ax=ax
)
# Draw the blue marble background.
m.bluemarble()
# Add the coastline and country boundaries.
m.drawcoastlines(color='k')
m.drawcountries(color='k')
# Add the parallels and meridians.
parallels = range(int(minLat), int(maxLat)+1, 4)
meridians = range(int(minLon), int(maxLon)+1, 6)
m.drawparallels(
parallels,
labels=[1, 0, 0, 0],
fontsize=14,
linewidth=0.5
)
m.drawmeridians(
meridians,
labels=[0, 0, 0, 1],
fontsize=14,
linewidth=0.5
)
# Set the title of the plot.
plt.title('Map of Arabia', fontsize=20)
# Display the plot.
plt.show()
In [ ]:
Copied!