Arctic region¶
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 = 66.0, 90.0
minLon, maxLon = -180.0, 180.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='npstere',
boundinglat=minLat,
lon_0=0.0,
resolution='l',
round=True,
ax=ax
)
# Draw the blue marble background.
m.bluemarble()
# Add the coastline.
m.drawcoastlines(color='k')
# Add the parallels and meridians.
parallels = np.arange(60, 91, 10)
meridians = np.arange(-180, 181, 30)
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 the Arctic', 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 = 66.0, 90.0
minLon, maxLon = -180.0, 180.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='npstere',
boundinglat=minLat,
lon_0=0.0,
resolution='l',
round=True,
ax=ax
)
# Draw the blue marble background.
m.bluemarble()
# Add the coastline.
m.drawcoastlines(color='k')
# Add the parallels and meridians.
parallels = np.arange(60, 91, 10)
meridians = np.arange(-180, 181, 30)
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 the Arctic', fontsize=20)
# Save the figure and display it.
plt.show()
Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).
In [ ]:
Copied!