In [4]:
HTML('<iframe src="https://matplotlib.org/basemap/api/basemap_api.html" width=960 height=350></iframe>')
Out[4]:
https://matplotlib.org/basemap/api/basemap_api.html
resolution: Can be c (crude), l (low), i (intermediate), h (high), f (full) or None
In [2]:
%pylab inline
from IPython.core.display import Image
from IPython.display import HTML
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
## little helper to pixel-perfectly render a figure as an inline image
def showFigure(fg, filename, dpi=100, facecolor='0.95') :
plt.savefig(filename, dpi=dpi, facecolor=facecolor)
plt.close(fg)
return Image(filename=filename)
In [3]:
path = '/media/noiv/OS/Octets/Projects/weather-simulation/images/data/'
names = ['top', 'front', 'left', 'right', 'back', 'bottom']
lats = [90, 0, 0, 0, 0, -90]
lons = [ 0, 0, -90, 90, 180, 0]
reso = 1024
colCont = '#333333' # '0.5'
colRiver = '#555555' # '0.5'
colLake = '#555555' # '0.6'
colWater = '#808080' # '0.7'
rsphere = 6370997.; width = 2.0 * rsphere; height = width
for (lat, lon, name) in zip(lats, lons, names) :
fg, ax = plt.subplots(figsize=(reso/100.0, reso/100.0), dpi=100, facecolor=(0, 0, 0, 0))
ax.axes.get_yaxis().set_visible(False)
ax.axes.get_xaxis().set_visible(False)
ax.set_frame_on(False)
ax.set_position((0, 0, 1, 1))
m = Basemap(width=width, height=height, rsphere=rsphere, projection='gnom', lat_0=lat, lon_0=lon, resolution='l', fix_aspect=False, suppress_ticks=True)
## m.fillcontinents(color=colCont, lake_color=colLake)
## m.drawmapboundary(fill_color=colWater, linewidth=0)
m.drawrivers(linewidth=0.3, color=colRiver)
filename = path + 'globe.data.' + name + '.' + str(reso) + '.png'
plt.savefig(filename, dpi=100, quality=100)
print filename
print 'Done'
In [ ]:
In [ ]:
In [ ]: