Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor patch for parallel coordinate plot #976

Merged
merged 1 commit into from
Aug 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add capability to overwrite labels of highlighted models
  • Loading branch information
lee1043 committed Aug 25, 2023
commit e7490026c1d619535d21ee54a074f74e8e657f01
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def parallel_coordinate_plot(
model_names,
models_to_highlight=list(),
models_to_highlight_colors=None,
models_to_highlight_labels=None,
fig=None,
ax=None,
figsize=(15, 5),
Expand Down Expand Up @@ -51,6 +52,7 @@ def parallel_coordinate_plot(
- `model_names`: list, name of models for markers/lines (axis=0)
- `models_to_highlight`: list, default=None, List of models to highlight as lines
- `models_to_highlight_colors`: list, default=None, List of colors for models to highlight as lines
- `models_to_highlight_labels`: list, default=None, List of string labels for models to highlight as lines
- `fig`: `matplotlib.figure` instance to which the parallel coordinate plot is plotted.
If not provided, use current axes or create a new one. Optional.
- `ax`: `matplotlib.axes.Axes` instance to which the parallel coordinate plot is plotted.
Expand Down Expand Up @@ -222,7 +224,13 @@ def parallel_coordinate_plot(
color = models_to_highlight_colors[mh_index]
else:
color = colors[j]
ax.plot(range(N), zs[j, :], "-", c=color, label=model, lw=3)

if models_to_highlight_labels is not None:
label = models_to_highlight_labels[mh_index]
else:
label = model

ax.plot(range(N), zs[j, :], "-", c=color, label=label, lw=3)
mh_index += 1
else:
if identify_all_models:
Expand Down
Loading