Skip to content

Commit 58868f5

Browse files
committed
#1 Work in progress:
- Update README - Update figures [ci skip]
1 parent 20e10b8 commit 58868f5

File tree

3 files changed

+74
-13
lines changed

3 files changed

+74
-13
lines changed

README.md

Lines changed: 74 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,32 +25,93 @@ pip install ezgpx
2525

2626
```python
2727
import ezgpx
28+
import matplotlib
2829

2930
# Parse GPX file
3031
gpx = ezgpx.GPX("file.gpx")
3132

3233
# Simplify (using Ramer-Dougle-Peucker algorithm)
3334
gpx.simplify()
3435

35-
# Plot with Matplotlib
36-
gpx.matplotlib_plot(color="elevation",
37-
start_stop_colors=("green", "red"),
38-
way_points_color="blue",
39-
title=gpx.name(),
40-
duration=(0, 0),
41-
distance=(0.5, 0),
42-
ascent=None,
43-
pace=(1, 0),
44-
speed=None,
45-
file_path="img_1")
46-
4736
# Remove metadata
4837
gpx.remove_metadata()
4938

39+
# Plot with Matplotlib
40+
test_gpx.matplotlib_plot(figsize=(16,9),
41+
size=6,
42+
color="ele",
43+
cmap=matplotlib.cm.get_cmap("gnuplot", 12),
44+
colorbar=False,
45+
start_point_color="green",
46+
stop_point_color="red",
47+
way_points_color=None,
48+
background="World_Imagery",
49+
offset_percentage=0.04,
50+
dpi=100,
51+
title=test_gpx.name(),
52+
title_fontsize=20,
53+
watermark=True,
54+
file_path="img_1.png")
55+
5056
# Write new simplified GPX file
5157
gpx.to_gpx("new_file.gpx")
5258
```
53-
![](img/matplotlib_plot_1.png)
59+
![](img/matplotlib_plot_1.jpg)
60+
61+
## 🏋️ Advanced Use
62+
63+
```python
64+
import ezgpx
65+
import matplotlib
66+
67+
# Parse GPX file
68+
gpx = ezgpx.GPX("file.gpx")
69+
70+
# Plot with Matplotlib
71+
test_gpx.expert_plot(figsize=(16,9),
72+
subplots=(3,2),
73+
map_position=(0,0),
74+
map_size=10,
75+
map_color="ele",
76+
map_cmap=matplotlib.cm.get_cmap("viridis", 12),
77+
map_colorbar=True,
78+
start_point_color=None,
79+
stop_point_color=None,
80+
way_points_color=None,
81+
background="World_Imagery",
82+
offset_percentage=0.04,
83+
xpixels=1000,
84+
ypixels=None,
85+
dpi=100,
86+
elevation_profile_position=(1,0),
87+
elevation_profile_size=10,
88+
elevation_profile_color="ele",
89+
elevation_profile_cmap=matplotlib.cm.get_cmap("viridis", 12),
90+
elevation_profile_colorbar=False,
91+
elevation_profile_grid=True,
92+
elevation_profile_fill_color="lightgray",
93+
elevation_profile_fill_alpha=0.5,
94+
pace_graph_position=(2,0),
95+
pace_graph_size=10,
96+
pace_graph_color="ele",
97+
pace_graph_cmap=None,
98+
pace_graph_colorbar=False,
99+
pace_graph_grid=True,
100+
pace_graph_fill_color="lightgray",
101+
pace_graph_fill_alpha=0.5,
102+
pace_graph_threshold=15,
103+
ascent_rate_graph_position=(1,1),
104+
made_with_ezgpx_position=(0,1),
105+
shared_color="ele",
106+
shared_cmap=None,
107+
shared_colorbar=True,
108+
data_table_position=(2,1),
109+
title=test_gpx.name(),
110+
title_fontsize=20,
111+
watermark=False,
112+
file_path="img_2.png")
113+
```
114+
![](img/expert_plot_1.jpg)
54115

55116
## 👤 Author
56117
- Fabien ALLEMAND

img/expert_plot_1.jpg

95.6 KB
Loading

img/matplotlib_plot_1.jpg

107 KB
Loading

0 commit comments

Comments
 (0)