Skip to content

Commit

Permalink
#1 Work in progress:
Browse files Browse the repository at this point in the history
- Update README
- Update figures

[ci skip]
  • Loading branch information
FABallemand committed Jan 27, 2024
1 parent 20e10b8 commit 58868f5
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 13 deletions.
87 changes: 74 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,93 @@ pip install ezgpx

```python
import ezgpx
import matplotlib

# Parse GPX file
gpx = ezgpx.GPX("file.gpx")

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

# Plot with Matplotlib
gpx.matplotlib_plot(color="elevation",
start_stop_colors=("green", "red"),
way_points_color="blue",
title=gpx.name(),
duration=(0, 0),
distance=(0.5, 0),
ascent=None,
pace=(1, 0),
speed=None,
file_path="img_1")

# Remove metadata
gpx.remove_metadata()

# Plot with Matplotlib
test_gpx.matplotlib_plot(figsize=(16,9),
size=6,
color="ele",
cmap=matplotlib.cm.get_cmap("gnuplot", 12),
colorbar=False,
start_point_color="green",
stop_point_color="red",
way_points_color=None,
background="World_Imagery",
offset_percentage=0.04,
dpi=100,
title=test_gpx.name(),
title_fontsize=20,
watermark=True,
file_path="img_1.png")

# Write new simplified GPX file
gpx.to_gpx("new_file.gpx")
```
![](img/matplotlib_plot_1.png)
![](img/matplotlib_plot_1.jpg)

## 🏋️ Advanced Use

```python
import ezgpx
import matplotlib

# Parse GPX file
gpx = ezgpx.GPX("file.gpx")

# Plot with Matplotlib
test_gpx.expert_plot(figsize=(16,9),
subplots=(3,2),
map_position=(0,0),
map_size=10,
map_color="ele",
map_cmap=matplotlib.cm.get_cmap("viridis", 12),
map_colorbar=True,
start_point_color=None,
stop_point_color=None,
way_points_color=None,
background="World_Imagery",
offset_percentage=0.04,
xpixels=1000,
ypixels=None,
dpi=100,
elevation_profile_position=(1,0),
elevation_profile_size=10,
elevation_profile_color="ele",
elevation_profile_cmap=matplotlib.cm.get_cmap("viridis", 12),
elevation_profile_colorbar=False,
elevation_profile_grid=True,
elevation_profile_fill_color="lightgray",
elevation_profile_fill_alpha=0.5,
pace_graph_position=(2,0),
pace_graph_size=10,
pace_graph_color="ele",
pace_graph_cmap=None,
pace_graph_colorbar=False,
pace_graph_grid=True,
pace_graph_fill_color="lightgray",
pace_graph_fill_alpha=0.5,
pace_graph_threshold=15,
ascent_rate_graph_position=(1,1),
made_with_ezgpx_position=(0,1),
shared_color="ele",
shared_cmap=None,
shared_colorbar=True,
data_table_position=(2,1),
title=test_gpx.name(),
title_fontsize=20,
watermark=False,
file_path="img_2.png")
```
![](img/expert_plot_1.jpg)

## 👤 Author
- Fabien ALLEMAND
Binary file added img/expert_plot_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/matplotlib_plot_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 58868f5

Please sign in to comment.