# Track visualization - Summaries


## Segment summaries

If multiple segments are included in a track, summaries per segments can be generated. Passing `kind="segment_summary"` in [`Track.plot`][geo_track_analyzer.track.GPXFileTrack.plot] will benerate bar charts with a `aggregate` value that must be passed as additional keyword agrument. Internally this will call the  [`plot_segment_summary`][geo_track_analyzer.visualize.plot_segment_summary] function. See the api documentation for all options that can be passed.

Currently the folloing aggregation metrics are supported:

- Passing `aggregate="avg_speed"` o generate a plot with the average velocity in a segment:

--8<-- "docs/snippets/examples/visualization/segment_summary_avg_speed.html"

- Passing `aggregate="max_speed"` o generate a plot with the maximum velocity in segment

--8<-- "docs/snippets/examples/visualization/segment_summary_max_speed.html"

 Passing `aggregate="total_distance"` o generate a plot with the total distance covered in segment

--8<-- "docs/snippets/examples/visualization/segment_summary_total_distance.html"

- Passing `aggregate="total_time"` o generate a plot with the total time spend in segment

--8<-- "docs/snippets/examples/visualization/segment_summary_total_time.html"

### Box plots

Box plots are a way to visualize how data is distributed in a given sample. If multiple segments are included in a track, such box plots can be generated by passing `kind="segment_box"` in [`Track.plot`][geo_track_analyzer.track.GPXFileTrack.plot] and one of the metrics `"heartrate"`, `"power"`, `"cadence"`, `"speed"`, `"elevation"` with the `metric` keyword. Internally this will call the  [`plot_segment_box_summary`][geo_track_analyzer.visualize.plot_segment_box_summary] function. See the api documentation for all options that can be passed.

--8<-- "docs/snippets/examples/visualization/segment_box_heartrate.html"

## Zone summaries

When defining [`Zones`][geo_track_analyzer.model.Zones] for `heartrate`, `cadence`, or `power`, visualizations summarizing some metric per zone are provided.

### Zones for the whole track

Using `kind="zone_summary"` in [`Track.plot`][geo_track_analyzer.track.GPXFileTrack.plot] will generate a figure bar representing an `aggregate` value for a `metric=heartrate|cadence|power`.  Internally this will call the  [`plot_track_zones`][geo_track_analyzer.visualize.plot_track_zones] function. See the api documentation for all options that can be passed.

Currently the following aggregation metrics are supported:

- Passing `aggregate="time"` to generate a plot with the total time spent in a zone of the passed `metric`:

--8<-- "docs/snippets/examples/visualization/zone_summary_hr_time.html"

- Passing `aggregate="distance"` in to generate a plot with the total distance covered in a zone of the passed `metric`:

--8<-- "docs/snippets/examples/visualization/zone_summary_hr_distance.html"

- Passing `aggregate="speed"` to generate a plot with the average velocity covered in a zone of the passed `metric`:

--8<-- "docs/snippets/examples/visualization/zone_summary_hr_speed.html"

### Zones per segement

Additionally the some aggregation metrics can be split per segment in a track by passing `kind="segment_zone_summary"`.  Internally this will call the  [`plot_segment_zones`][geo_track_analyzer.visualize.plot_segment_zones] function. See the api documentation for all options that can be passed.

--8<-- "docs/snippets/examples/visualization/zone_segment_summary_hr_time.html"

???+ warning "Errors will be raised"

    An `VisualizationSetupError` is passed if `aggregate` and `metric` keyword-argument pairs are **not passed** to the `plot` method for kinds `"zone_summary"` and `"segment_zone_summary"`
