Global Map¶
In [1]:
Copied!
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
import numpy as np
# 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.
m = Basemap(projection='cyl', resolution='h', ax=ax)
# Draw the blue marble background.
m.bluemarble()
# Add the coastlines and country boundaries.
m.drawcoastlines(color='k')
m.drawcountries(color='k')
# Add the parallels and meridians.
parallels = np.arange(-90, 91, 30)
meridians = np.arange(-180, 181, 60)
m.drawparallels(parallels, labels=[1, 0, 0, 0], fontsize=12, linewidth=0.5)
m.drawmeridians(meridians, labels=[0, 0, 0, 1], fontsize=12, linewidth=0.5)
# Set the title of the plot.
plt.title('Global Map', 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
# 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.
m = Basemap(projection='cyl', resolution='h', ax=ax)
# Draw the blue marble background.
m.bluemarble()
# Add the coastlines and country boundaries.
m.drawcoastlines(color='k')
m.drawcountries(color='k')
# Add the parallels and meridians.
parallels = np.arange(-90, 91, 30)
meridians = np.arange(-180, 181, 60)
m.drawparallels(parallels, labels=[1, 0, 0, 0], fontsize=12, linewidth=0.5)
m.drawmeridians(meridians, labels=[0, 0, 0, 1], fontsize=12, linewidth=0.5)
# Set the title of the plot.
plt.title('Global Map', fontsize=20)
# Save the figure and display it.
plt.show()
In [ ]:
Copied!