# plot_difference_by_relevant_distance { #brdr.viz.plot_difference_by_relevant_distance }

```python
viz.plot_difference_by_relevant_distance(
    dict_differences,
    xlabel='relevant distance',
    ylabel='difference',
    title='Relevant distance vs difference',
    save_path=None,
)
```

Plot geometric differences across multiple features as a line graph.

This function iterates through a nested dictionary where each key represents
a feature (or scenario) and its value is a dictionary mapping X-values
(typically 'relevant distance') to Y-values (geometric difference).

## Parameters {.doc-section .doc-section-parameters}

| Name             | Type                                   | Description                                                                                                                          | Default                             |
|------------------|----------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------|
| dict_differences | dict of dict                           | A nested dictionary structure: `{label: {x_value: y_value}}`. Example: `{'feature_1': {0.1: 0.5, 0.2: 0.3}}`.                        | _required_                          |
| xlabel           | [str](`str`)                           | Label for the X-axis.                                                                                                                | `"relevant distance"`               |
| ylabel           | [str](`str`)                           | Label for the Y-axis.                                                                                                                | `"difference"`                      |
| title            | [str](`str`)                           | The main title of the plot.                                                                                                          | `"Relevant distance vs difference"` |
| save_path        | [str](`str`) or [Path](`pathlib.Path`) | If provided, the plot will be saved to this directory or file path. If a directory is provided, a timestamped filename is generated. | `None`                              |

## Returns {.doc-section .doc-section-returns}

| Name   | Type   | Description                                                                        |
|--------|--------|------------------------------------------------------------------------------------|
|        | None   | The function displays the plot using `plt.show()` and optionally saves the figure. |

## Notes {.doc-section .doc-section-notes}

This function is particularly useful for sensitivity analysis—showing how
adjusting the `relevant_distance` parameter impacts the final
geometric outcome.