Relative Content

Tag Archive for pythonmatplotlibgeopandas

How to delete margin between figure and subplot in matplotlib

fig, ax = plt.subplots(figsize=(10, 6)) fig.patch.set_facecolor(‘#87ceeb’) ax.set_axis_off() ax.set_xlim(minx, maxx) ax.set_ylim(miny, maxy) gdf.plot(ax=ax, facecolor=’#dcdcdd’, edgecolor=’#a5abae’) plt.show() With this code i build this visualization: I tried many options like plt.subplots_adjust(left=0, right=1, top=1, bottom=0) And ax.set_position([0, 0, 1, 1]) etc. But all of them don’t work How can I delete a small margin between figure and visualization made […]

How to plot LinsString in gpd.GeoDataFrame?

I have a kml file that has LinrString and Polygon, I can plot polygon, but I am not sure how to plot LineString, I tried polys.boundary.plot(ax=axs, facecolor=color, color=color, label=legend, zorder=3), that seems like not work, how can I plot LineString in gpd.GeoDataFrame?