create a globe in python

Here's an example on how to create a globe using python and basemap:

main.py
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt

# Create a map using the Basemap class
m = Basemap(projection='ortho', 
            lat_0=0, lon_0=0)

# Draw coastlines, countries, and continents
m.drawcoastlines(linewidth=0.5)
m.drawcountries(linewidth=0.5)
m.fillcontinents(color='lightgray',lake_color='white')

# Draw parallels and meridians
m.drawparallels(range(-90, 91, 30))
m.drawmeridians(range(0, 361, 30))

# Draw the globe boundary
m.drawmapboundary()

# Display the map
plt.show()
520 chars
22 lines

This will produce an orthographic projection of the globe centered at 0°N, 0°E. You can modify the projection and center coordinates to create different views of the world.

gistlibby LogSnag