I am trying to plot a line in a GeoPandas dataframe via matplotlib. also I am adding a basemap and a polygon. However as seen in the picture below on the right top, the line is plotted with only a width of one pixel is too small. The error only arises, when I plot the image in a loop. When I plot the image only once, there is no error.
- setting base and ax to None at the beginning of each loop
- plt.close('all') at the beginning of each loop
geojsons=[geojson1,geojson2] for geojson in geojsons: base = planningarea.plot(color='none', edgecolor='black') add_basemap(base, zoom=11, url=ctx.sources.ST_TERRAIN_BACKGROUND) geojson.plot(ax=base, color='red') plt.show()
the add_basemap function is from here