plot_difference_by_relevant_distance
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
| 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 | Label for the X-axis. | "relevant distance" |
| ylabel | str | Label for the Y-axis. | "difference" |
| title | str | The main title of the plot. | "Relevant distance vs difference" |
| save_path | str or 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
| Name | Type | Description |
|---|---|---|
| None | The function displays the plot using plt.show() and optionally saves the figure. |
Notes
This function is particularly useful for sensitivity analysis—showing how adjusting the relevant_distance parameter impacts the final geometric outcome.