【发布时间】:2018-07-29 00:58:38
【问题描述】:
mplleaflet 与 Jupyter Notebook 中的“%matplotlib inline”模式配合得很好,但是当启用“%matplotilib notebook”模式时,单元格和地图之间有一大块空白。这可以避免吗?
代码:
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)
输出如下:
【问题讨论】:
标签: python matplotlib leaflet jupyter-notebook jupyter