conda install basemap matplotlib
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
img = 'Titan_VIMS_ISS.jpg'
map = Basemap(projection='ortho', lat_0=15, lon_0=0)
map.warpimage(img)
plt.savefig('Titan_ortho.jpg', bbox_inches='tight')
plt.show()
or
python wrap_sphere.py
Titan globe centered on (0º, 15ºN) with a geographic grid and a red dot a (lat, lon) = (30º, 45º)
- Titan VIMS/ISS background map (doi: 10.22002/D1.1173)
Install of Basemap from conda does not set the $PROJ_LIB
environment variable resulting in the following error:
>>> from mpl_toolkits.basemap import Basemap
KeyError: 'PROJ_LIB'
The issue is known (and should be fixed by now…) but here is a workaround if needed:
set "PROJ_LIB=%CONDA_PREFIX%\Library\share" # Windows
export PROJ_LIB=$CONDA_PREFIX/share/proj # Linux and OS X