|
|
|
@@ -8,6 +8,12 @@ import geopandas as gpd |
|
|
|
import contextily as cx |
|
|
|
import matplotlib.pyplot as plt |
|
|
|
|
|
|
|
import seaborn as sns |
|
|
|
|
|
|
|
sns.set() |
|
|
|
#sns.set(font_scale=1.5) |
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
|
parser = ArgumentParser() |
|
|
|
parser.add_argument("-f", "--file", required=True, help="Messfahrt csv") |
|
|
|
@@ -39,14 +45,20 @@ if __name__ == "__main__": |
|
|
|
|
|
|
|
df_wm = gdf.to_crs(epsg=3857) |
|
|
|
ax2 = df_wm.plot() |
|
|
|
ax2 = df_wm.plot(args.column, cmap="hot", legend=args.no_legend, ax=ax2) |
|
|
|
ax2 = df_wm.plot(column=args.column, cmap="hot", legend=args.no_legend, ax=ax2, legend_kwds={"label": args.label},) |
|
|
|
# ax2 = df_wm.plot.scatter(x="longitude", y="latitude", c="kmh", cmap="hot") |
|
|
|
# zoom 17 is pretty |
|
|
|
cx.add_basemap(ax2, source=cx.providers.OpenStreetMap.Mapnik, zoom=17) |
|
|
|
|
|
|
|
# gdf.plot() |
|
|
|
ax2.set_axis_off() |
|
|
|
ax2.set_title(args.label if args.label else args.column) |
|
|
|
if not args.no_legend: |
|
|
|
ax2.set_title(args.label if args.label else args.column) |
|
|
|
else: |
|
|
|
fig = ax2.figure |
|
|
|
cb_ax = fig.axes[0] |
|
|
|
cb_ax.set_label(args.label) |
|
|
|
cb_ax.tick_params(labelsize=30) |
|
|
|
|
|
|
|
if args.show_providerinfo: |
|
|
|
##################################### |
|
|
|
@@ -68,6 +80,6 @@ if __name__ == "__main__": |
|
|
|
# df.plot(x="longitude", y="latitude", kind="scatter", colormap="YlOrRd") |
|
|
|
|
|
|
|
if args.save: |
|
|
|
plt.savefig("{}gps_plot.pdf".format(args.save)) |
|
|
|
plt.savefig("{}gps_plot.eps".format(args.save), bbox_inches="tight") |
|
|
|
else: |
|
|
|
plt.show() |