我正在研究各种因素对巴黎所谓的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的方法。现在我有这个代码,但它与我想要显示的内容无关:
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)
T(k)/ Tt是(占用率/平均占用率),R_0是包含所有数据的列表
map()
答案 0 :(得分:0)
好像你需要:
matplotlib.pyplot.contour(x, y, z)
matplotlib.pyplot.contourf(x, y, z)
带参数x - 纬度,y - 经度和z - 占有率。