mplleaflet适用于'%matplotlib inline'在Jupyter笔记本中的模式,但是当启用'%matplotilib笔记本时'模式,在单元格和地图之间有一大块空白。这可以避免吗?
代码:
import matplotlib.pyplot as plt
import mplleaflet
%matplotlib notebook
#some latitudes bracketing seattle
lats = [47.5062,47.7062]
#longitude
lons = [-122.3321]*len(lats)
fig,ax=plt.subplots(figsize=(8,8))
ax.scatter(lons, lats, alpha=0) #invisible data points, just to scale the map
mplleaflet.display(fig=fig)
输出如下: