擅长:python、mysql、java
<p>下面是我用点绘制的。我实际上是想把一个<a href="https://github.com/collinreinking/longitude_latitude_dot_plots_in_python_with_folium" rel="nofollow noreferrer">notebook of examples (adding color, popup, etc)</a>放在一起,尽管我还在解决这些问题。</p>
<pre><code>import folium
import pandas as pd
#create a map
this_map = folium.Map(prefer_canvas=True)
def plotDot(point):
'''input: series that contains a numeric named latitude and a numeric named longitude
this function creates a CircleMarker and adds it to your this_map'''
folium.CircleMarker(location=[point.latitude, point.longitude],
radius=2,
weight=0).add_to(this_map)
#use df.apply(,axis=1) to "iterate" through every row in your dataframe
data.apply(plotDot, axis = 1)
#Set the zoom to the maximum possible
this_map.fit_bounds(this_map.get_bounds())
#Save the map to an HTML file
this_map.save('html_map_output/simple_dot_plot.html')
this_map
</code></pre>
<p>您也可以使用<a href="https://gist.github.com/wrobstory/5609786" rel="nofollow noreferrer">polygon markers that this guy shows off</a>。</p>