Reputation: 69
I have a shapely object in python. It is the outline of the map of the US. How do I save it as an EPS or PDF?
Upvotes: 4
Views: 431
Reputation: 1949
I have a multipolygon object:
import matplotlib.pyplot as plt
from shapely.plotting import plot_polygon
print(type(multipolygon))
#<class 'shapely.geometry.multipolygon.MultiPolygon'>
fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(8,5))
plot_polygon(polygon=multipolygon, ax=ax, add_points=False, color="green")
fig.savefig(r"C:\Users\bera\Desktop\gistest\usa.pdf", bbox_inches='tight')
Upvotes: 0