1

I created one geodataframe with geopandas. The geometry field was filled with Multipoint. However, when I try to plot the map to see multipoints, my map returned empty.

How can I plot geometry field (multipoint) using geopandas?

Here is a piece of it:

from geopandas import GeoSeries
from shapely.geometry import Point, MultiPoint

gs = GeoSeries([MultiPoint([(-120, 45), (121, 46)]), 
                MultiPoint([(-121.2, 46), (-123, 48)]), 
                MultiPoint([(-122.9, 47.5), (-125, 49)])])
print(gs)

gs.plot(marker='*', color='red', markersize=12, figsize=(4, 4))
1

Documentation suggests that the plot_series() function does not currently support MultiPoint geometries.

enter image description here

Would a single point geometry plot suffice for your purposes?

from geopandas import GeoSeries
from shapely.geometry import Point

pnts = [(-120, 45), (-121, 46), (-121.2, 46), (-123, 48), (-122.9, 47.5), (-125, 49)]
gs = GeoSeries(Point(pnt[0],pnt[1]) for pnt in pnts)
ax = gs.plot(marker='*', color='red', markersize=12, figsize=(4, 4))
ax.set_xbound(-126, -119)
ax.set_ybound(44, 50)

enter image description here

  • Perfect! Sincerely yours. – Diogo Caribé May 15 '17 at 19:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.