Skip to content

Commit

Permalink
Merge pull request #976 from PCMDI/lee1043_parallel_plot_patch
Browse files Browse the repository at this point in the history
Minor patch for parallel coordinate plot
  • Loading branch information
lee1043 authored Aug 26, 2023
2 parents a62125f + e749002 commit 10b7ad0
Showing 1 changed file with 9 additions and 1 deletion.
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

0 comments on commit 10b7ad0

Please # to comment.