Skip to content

Commit 244dbd0

Browse files
committed
#5 #1 Work in progress:
-Improve plot methods -Parser and writer error handling -Documentation -Update examples [ci skip]
1 parent 7466780 commit 244dbd0

File tree

4 files changed

+358
-214
lines changed

4 files changed

+358
-214
lines changed

examples/plot.py

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,49 @@
44
gpx = ezgpx.GPX("file.gpx")
55

66
# Plot with Matplotlib
7-
gpx.matplotlib_plot(title="Track", base_color="#FF0000",
8-
start_stop=True, way_points=False, file_path="img_1")
7+
gpx.matplotlib_plot(elevation_color=True,
8+
start_stop_colors=("green", "red"),
9+
way_points_color="blue",
10+
title=gpx.name(),
11+
duration=(0, 0),
12+
distance=(0.5, 0),
13+
ascent=None,
14+
pace=(1, 0),
15+
speed=None,
16+
file_path="img_1")
917

1018
# Plot with Matplotlib Basemap Toolkit
11-
gpx.matplotlib_basemap_plot(title="Track", base_color="#00FF00",
12-
start_stop=False, way_points=False, file_path="img_2")
19+
gpx.matplotlib_basemap_plot(base_color="darkorange",
20+
start_stop_colors=("darkgreen", "darkred"),
21+
way_points_color="darkblue",
22+
title=gpx.name(),
23+
duration=(0,0),
24+
distance=(0.5,0),
25+
ascent=None,
26+
pace=None,
27+
speed=(1,0),
28+
file_path="img_2")
1329

1430
# Plot with gmap (Google Maps)
15-
gpx.gmap_plot(title="Track", base_color="#0000FF", start_stop=True,
16-
way_points=True, file_path="map_1.html", open=True)
31+
gpx.gmap_plot(base_color="yellow",
32+
start_stop_colors=("green", "red"),
33+
way_points_color="blue",
34+
zoom=14,
35+
title=gpx.name(),
36+
file_path="map_1.html",
37+
open=False)
1738

1839
# Plot with Folium
19-
gpx.folium_plot(title="Track", tiles="OpenStreetMap", base_color="#000000", start_stop=True,
20-
way_points=True, minimap=True, coord_popup=True, file_path="map_2.html", open=True)
40+
gpx.folium_plot(tiles="OpenStreetMap",
41+
base_color="orange",
42+
start_stop_colors=("green", "red"),
43+
way_points_color="blue",
44+
minimap=True,
45+
coord_popup=False,
46+
title="Very nice track!",
47+
zoom=8,
48+
file_path="map_2.html",
49+
open=True)
2150

2251
# Write new GPX file
2352
gpx.to_gpx("new_file.gpx")

0 commit comments

Comments
 (0)