South Korea¶
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 = 32, 39
minLon, maxLon = 124, 132
# 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(30, 40, 1)
meridians = np.arange(120, 135, 1)
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 South Korea', 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 = 32, 39
minLon, maxLon = 124, 132
# 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(30, 40, 1)
meridians = np.arange(120, 135, 1)
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 South Korea', fontsize=20)
# Save the figure and display it.
plt.show()
In [ ]:
Copied!