Shapely #3 기하 도형 그리기(Plot)
Shapely 라이브러리는 기하학적 객체를 읽고, 쓰고, 분석하는 일을 하지만 해당 객체를 그려주지는 않는다. Python에서 matplotlib는 도형정보를 그리는 모듈 중 하나인데, 이를 이용해 shapely의 기하정보를 그릴 수 있다. 설치 방법은 pip install matplotlib 하면 설치된다. import matplotlib.pyplot as plt from shapely.geometry import Polygon fig, ax = plt.subplots() # Create Polygon exterior = [(20, 20), (50, 70), (80, 20)] poly = Polygon(exterior) # Plot Polygon xe, ye = poly.exterior.xy ax.pl..
2022. 11. 14.