You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pcmdi_metrics/graphics/parallel_coordinate_plot/parallel_coordinate_plot_lib.py
+72-24Lines changed: 72 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,11 @@ def parallel_coordinate_plot(
15
15
metric_names,
16
16
model_names,
17
17
models_to_highlight=list(),
18
+
models_to_highlight_by_line=True,
18
19
models_to_highlight_colors=None,
19
20
models_to_highlight_labels=None,
21
+
models_to_highlight_markers=["s", "o", "^", "*"],
22
+
models_to_highlight_markers_size=10,
20
23
fig=None,
21
24
ax=None,
22
25
figsize=(15, 5),
@@ -37,7 +40,10 @@ def parallel_coordinate_plot(
37
40
group2_name="group2",
38
41
comparing_models=None,
39
42
fill_between_lines=False,
40
-
fill_between_lines_colors=("green", "red"),
43
+
fill_between_lines_colors=("red", "green"),
44
+
arrow_between_lines=False,
45
+
arrow_between_lines_colors=("red", "green"),
46
+
arrow_alpha=1,
41
47
vertical_center=None,
42
48
vertical_center_line=False,
43
49
vertical_center_line_label=None,
@@ -50,9 +56,12 @@ def parallel_coordinate_plot(
50
56
- `data`: 2-d numpy array for metrics
51
57
- `metric_names`: list, names of metrics for individual vertical axes (axis=1)
52
58
- `model_names`: list, name of models for markers/lines (axis=0)
53
-
- `models_to_highlight`: list, default=None, List of models to highlight as lines
59
+
- `models_to_highlight`: list, default=None, List of models to highlight as lines or marker
60
+
- `models_to_highlight_by_line`: bool, default=True, highlight as lines. If False, as marker
54
61
- `models_to_highlight_colors`: list, default=None, List of colors for models to highlight as lines
55
62
- `models_to_highlight_labels`: list, default=None, List of string labels for models to highlight as lines
63
+
- `models_to_highlight_markers`: list, matplotlib markers for models to highlight if as marker
64
+
- `models_to_highlight_markers_size`: float, size of matplotlib markers for models to highlight if as marker
56
65
- `fig`: `matplotlib.figure` instance to which the parallel coordinate plot is plotted.
57
66
If not provided, use current axes or create a new one. Optional.
58
67
- `ax`: `matplotlib.axes.Axes` instance to which the parallel coordinate plot is plotted.
@@ -76,7 +85,10 @@ def parallel_coordinate_plot(
76
85
- `group2_name`: string, needed for violin plot legend if splited to two groups, for the 2nd group. Default is 'group2'.
77
86
- `comparing_models`: tuple or list containing two strings for models to compare with colors filled between the two lines.
78
87
- `fill_between_lines`: bool, default=False, fill color between lines for models in comparing_models
79
-
- `fill_between_lines_colors`: tuple or list containing two strings for colors filled between the two lines. Default=('green', 'red')
88
+
- `fill_between_lines_colors`: tuple or list containing two strings of colors for filled between the two lines. Default=('red', 'green')
89
+
- `arrow_between_lines`: bool, default=False, place arrows between two lines for models in comparing_models
90
+
- `arrow_between_lines_colors`: tuple or list containing two strings of colors for arrow between the two lines. Default=('red', 'green')
91
+
- `arrow_alpha`: float, default=1, transparency of arrow (faction between 0 to 1)
80
92
- `vertical_center`: string ("median", "mean")/float/integer, default=None, adjust range of vertical axis to set center of vertical axis as median, mean, or given number
81
93
- `vertical_center_line`: bool, default=False, show median as line
82
94
- `vertical_center_line_label`: str, default=None, label in legend for the horizontal vertical center line. If not given, it will be automatically assigned. It can be turned off by "off"
0 commit comments