ezgpx.plotters package
Submodules
ezgpx.plotters.folium_plotter module
- class ezgpx.plotters.folium_plotter.FoliumPlotter(gpx: GPX)[source]
Bases:
PlotterGPX plotter based on folium.
- plot(tiles: str = 'OpenStreetMap', color: str = '#FFA800', start_stop_colors: Tuple[str, str] | None = None, waypoints_color: str | None = None, minimap: bool = False, coord_popup: bool = False, title: str | None = None, zoom: float = 12.0, file_path: str | None = None, browser: bool = True)[source]
Plot GPX using folium.
- Args:
- tiles (str, optional): Map tiles. Supported tiles:
“OpenStreetMap”, “Stamen Terrain”, “Stamen Toner”. Defaults to “OpenStreetMap”.
- start_stop_colors (Optional[Tuple[str, str]], optional):
Start and stop points colors. Defaults to None.
- waypoints_color (Optional[str], optional): Way points
color. Defaults to None.
minimap (bool, optional): Add minimap. Defaults to False. coord_popup (bool, optional): Add coordinates pop-up when
clicking on the map. Defaults to False.
- title (Optional[str], optional): Title of the plot.
Defaults to None.
zoom (float, optional): Zoom. Defaults to 12.0. file_path (Optional[str], optional): Path to save plot.
Defaults to None.
- browser (bool, optional): Open the plot in the default web
browser. Defaults to True.
ezgpx.plotters.gmplot_plotter module
- class ezgpx.plotters.gmplot_plotter.GmplotPlotter(gpx: GPX)[source]
Bases:
PlotterGPX plotter based on gmplot.
- plot(color: str = '#FFA800', start_stop_colors: Tuple[str, str] | None = None, waypoints_color: str | None = None, scatter: bool = False, plot: bool = True, zoom: float = 10.0, title: str | None = None, file_path: str | None = None, browser: bool = True)[source]
Plot GPX using gmplot.
- Args:
color (str, optional): Track color. Defaults to “#FFA800”. start_stop_colors (Optional[Tuple[str, str]], optional):
Start and stop points colors. Defaults to None.
- waypoints_color (Optional[str], optional): Way points
color. Defaults to None.
- scatter (bool, optional): Scatter track points. Defaults
to False.
plot (bool, optional): Plot track points. Defaults to True. zoom (float, optional): Zoom. Defaults to 10.0. title (Optional[str], optional): Title of the plot.
Defaults to None.
- file_path (Optional[str], optional): Path to save plot.
Defaults to None.
- browser (bool, optional): Open the plot in the default
web browser. Defaults to True.
ezgpx.plotters.matplotlib_anim_plotter module
- class ezgpx.plotters.matplotlib_anim_plotter.MatplotlibAnimPlotter(gpx: GPX)[source]
Bases:
PlotterGPX animated plotter based on Matplotlib.
- plot(figsize: Tuple[int, int] = (16, 9), size: float = 5, color: str = '#FFA800', background: str | None = None, offset_percentage: float = 0.04, dpi: int = 96, interval: float = 20, fps: int = 24, bitrate: int = 1800, repeat: bool = True, title: str | None = None, title_fontsize: int = 20, watermark: bool = False, file_path: str = None)[source]
Plot (animation) GPX using Matplotlib.
Crashes may be due to parametres exceeding system capabilities. Try reducing fps and/or bitrate.
- Args:
- figsize (Tuple[int, int], optional): Width and height of
the plot. Defaults to (16, 9).
size (float, optional): Size of the track. Defaults to 5. color (str, optional): Color of the track. Defaults to
“#FFA800”.
- background (Optional[str], optional): Map tiles to use.
Possible choice are: None, “bluemarble”, “shadedrelief”, “etopo”, “World_Imagery”, “wms” or any server supported by mpl_toolkits.basemap.Basemap.arcgisimage. Defaults to None.
- offset_percentage (float, optional): Offset percentage to
apply to the track bounding box. Defaults to 0.04.
- dpi (int, optional): Resolution of the animation. Defaults
to 96.
- interval (float, optional): Interval between frames of the
animation. Defaults to 20.
fps (int, optional): FPS of the animation. Defaults to 24. bitrate (int, optional): Bit-rate of the animation.
Defaults to 1800.
- repeat (bool, optional): Repeat the animation when viewed.
Defaults to True.
- title (Optional[str], optional): Title of the plot.
Defaults to None.
- title_fontsize (int, optional): Font size of the title of
the plot. Defaults to 20.
watermark (bool, optional): Watermark. Defaults to False. file_path (str, optional): Path to save the plot. Defaults
to None.
- Raises:
FileNotFoundError: Provided path does not exist.
- Returns:
matplotlib.Figure: Animated plot of the GPX.
ezgpx.plotters.matplotlib_plotter module
- class ezgpx.plotters.matplotlib_plotter.MatplotlibPlotter(gpx: GPX)[source]
Bases:
PlotterGPX plotter based on Matplotlib.
- plot(figsize: Tuple[int, int] = (16, 9), size: float = 5, color: str = '#FFA800', cmap: matplotlib.colors.Colormap | None = None, colorbar: bool = False, start_point_color: str | None = None, stop_point_color: str | None = None, waypoints_color: str | None = None, background: str | None = None, offset_percentage: float = 0.04, dpi: int = 96, title: str | None = None, title_fontsize: int = 20, watermark: bool = False, file_path: str = None)[source]
Plot GPX using Matplotlib.
- Args:
- figsize (Tuple[int, int], optional): Width and height of
the plot. Defaults to (16, 9).
size (float, optional): Size of the track. Defaults to 5. color (str, optional): Color of the track. Possible choice
are: “lat”, “lon”, “ele”, “speed”, “pace”, “vertical_drop”, “ascent_rate”, “ascent_speed” or any valid color string. Defaults to “#FFA800”.
- cmap (Optional[matplotlib.colors.Colormap], optional):
Colormap to use when color is not a fixed color value. Defaults to None.
colorbar (bool, optional): Add colorbar. Defaults to False. start_point_color (Optional[str], optional): Color of the
first point. Defaults to None.
- stop_point_color (Optional[str], optional): Color of the
last point. Defaults to None.
- waypoints_color (Optional[str], optional): Color of the
way points. Defaults to None.
- background (Optional[str], optional): Map tiles to use.
Possible choice are: None, “bluemarble”, “shadedrelief”, “etopo”, “World_Imagery”, “wms” or any server supported by mpl_toolkits.basemap.Basemap.arcgisimage. Defaults to None.
- offset_percentage (float, optional): Offset percentage to
apply to the track bounding box. Defaults to 0.04.
- dpi (int, optional): Resolution of the animation. Defaults
to 96.
- interval (float, optional): Interval between frames of the
animation. Defaults to 20.
- bitrate (int, optional): Bit-rate of the animation.
Defaults to 1800.
- repeat (bool, optional): Repeat the animation when viewed.
Defaults to True.
- title (Optional[str], optional): Title of the plot.
Defaults to None.
- title_fontsize (int, optional): Font size of the title of
the plot. Defaults to 20.
watermark (bool, optional): Watermark. Defaults to False. file_path (str, optional): Path to save the plot. Defaults
to None.
- Raises:
FileNotFoundError: Provided path does not exist.
- Returns:
matplotlib.Figure: Plot of the GPX.
ezgpx.plotters.plotly_anim_plotter module
- class ezgpx.plotters.plotly_anim_plotter.PlotlyAnimPlotter(gpx: GPX)[source]
Bases:
PlotterGPX animated plotter based on Plotly.
- plot(tiles: str = 'open-street-map', color: str = '#FFA800', title: str | None = None, zoom: float = 12.0, file_path: str | None = None)[source]
Plot (animation) GPX using Plotly.
- Args:
- tiles (str, optional): Map tiles to use. Defaults to
“open-street-map”.
- title (Optional[str], optional): Title of the plot.
Defaults to None.
zoom (float, optional): Zoom. Defaults to 12.0. file_path (Optional[str], optional): Path to save the plot. Defaults to None.
- Raises:
FileNotFoundError: Provided path does not exist.
- Returns:
plotly.Figure: Animated plot of the GPX.
ezgpx.plotters.plotly_plotter module
- class ezgpx.plotters.plotly_plotter.PlotlyPlotter(gpx: GPX)[source]
Bases:
PlotterGPX plotter based on Plotly.
- plot(tiles: str = 'open-street-map', mode: str = 'lines', color: str = '#FFA800', start_point_color: str | None = None, stop_point_color: str | None = None, waypoints_color: str | None = None, title: str | None = None, zoom: float | None = None, file_path: str | None = None)[source]
Plot (animation) GPX using Plotly.
- Args:
- tiles (str, optional): Map tiles to use. Defaults to
“open-street-map”.
- start_point_color (Optional[str], optional): Color of the
first point. Defaults to None.
- stop_point_color (Optional[str], optional): Color of the
last point. Defaults to None.
- waypoints_color (Optional[str], optional): Color of the
way points. Defaults to None.
- title (Optional[str], optional): Title of the plot.
Defaults to None.
zoom (float, optional): Zoom. Defaults to 12.0. file_path (Optional[str], optional): Path to save the plot. Defaults to None.
- Returns:
_type_: _description_