In the first step, I have already created a plot from polygon shapefile, gpd here refers to the geopandas, the code is like below:
data = gpd.read_file('data.shp')
fig, axes = plt.subplots(figsize=(10,8))
data.plot(ax = axes, color = "white", edgecolor = "black")
plt.plot()
After this, I have a polygon plot, now I have another csv file containing coordinate information, I want to plot these points onto the previous polygon plot, I try code as below to access the coordinate information:
lat=[]
lon=[]
with open('data.csv') as csvfile:
reader = csv.reader(csvfile,delimiter=',')
for data in reader:
lat.append(float(data[2]))
lon.append(float(data[3]))
I check the lat and lon, no problem, but what should I do next so that I can show both points and polygon at the same time?
axesfor plotting. Just re-use it, simply tryaxes.scatter(lon, lat)and tell us what you get.