Asia¶
In [1]:
Copied!
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
import numpy as np
# Set the latitudinal and longitudinal limits of the map.
minLat, maxLat = -10, 65
minLon, maxLon = 60, 150
# 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 = np.arange(0, 70, 10)
meridians = np.arange(60, 160, 10)
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 Asia', fontsize=20)
# Save the figure and display it.
plt.show()
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
import numpy as np
# Set the latitudinal and longitudinal limits of the map.
minLat, maxLat = -10, 65
minLon, maxLon = 60, 150
# 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 = np.arange(0, 70, 10)
meridians = np.arange(60, 160, 10)
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 Asia', fontsize=20)
# Save the figure and display it.
plt.show()
In [ ]:
Copied!