In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
import tilemapbase
tilemapbase.init()
tilemapbase.__version__
Out[1]:
In [2]:
import collections
BBox = collections.namedtuple("BBox", "minx maxx miny maxy")
In [3]:
bbox = BBox(-2.8197899, -0.691999, 50.5380771, 50.8583224)
In [4]:
t = tilemapbase.tiles.build_OSM()
extent = tilemapbase.Extent.from_lonlat(
longitude_min=bbox.minx,
longitude_max=bbox.maxx,
latitude_min=bbox.miny,
latitude_max=bbox.maxy)
#extent = extent.to_aspect(1)
fig, ax = plt.subplots(figsize=(8, 8), dpi=100)
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)
plotter = tilemapbase.Plotter(extent, t, width=600)
plotter.plot(ax)
In [5]:
extent1 = extent.to_aspect(1)
In [6]:
fig, ax = plt.subplots(figsize=(8, 8), dpi=100)
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)
plotter = tilemapbase.Plotter(extent1, t, width=600)
plotter.plot(ax)
In [7]:
extent2 = extent.to_aspect(1, False)
In [8]:
fig, ax = plt.subplots(figsize=(8, 8), dpi=100)
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)
plotter = tilemapbase.Plotter(extent2, t, width=600)
plotter.plot(ax)
In [ ]: