我正在研究各种因素对自行车在巴黎一个名为Velib的自行车共享系统中分布的影响。我有1222个自行车站,他们的占有率,他们的纬度和经度。我想做一个这样的地图:(http://images.google.fr/imgres?imgurl=http%3A%2F%2Fscipy-cookbook.readthedocs.org%2F_images%2Fgriddataexample1.png&imgrefurl=https%3A%2F%2Fwizardforcel.gitbooks.io%2Fscipy-cookbook-en%2Fcontent%2F37.html&h=288&w=432&tbnid=j0EtJS7s1utbYM%3A&docid=KQV-DInQ9QIq2M&ei=L2ADWJqUJ8L9aemiiYAJ&tbm=isch&client=safari&iact=rc&uact=3&dur=1229&page=13&start=324&ndsp=31&ved=0ahUKEwja57uTmN_PAhXCfhoKHWlRApA4rAIQMwg0KDEwMQ&bih=739&biw=1438)但是我想不出使用marplotlib的方法。现在我有这段代码,但它与我想要展示的内容无关:
for k in range(number gf bike stations):T(k)/Tt是(占有率/平均占有率),R_0是包含所有数据的列表
if T(k)/Tt>1.5: (if the occupation ratio is >1.5, i scatter a green dot and so on)
ax.scatter(R_0[k]['position']['lng'],R_0[k]['position']['lat'], color='g', s=10)
elif T(k)/Tt>1: (yellow dot)
ax.scatter(R_0[k]['position']['lng'],R_0[k]['position']['lat'], color='y', s=10)
elif T(k)/Tt>0.5: (red dot)
ax.scatter(R_0[k]['position']['lng'],R_0[k]['position']['lat'], color='r', s=10)发布于 2016-10-16 20:05:47
看起来你需要:
matplotlib.pyplot.contour(x, y, z)
matplotlib.pyplot.contourf(x, y, z)带有参数x-纬度,y-经度和z-占用率。
https://stackoverflow.com/questions/40069683
复制相似问题