Skip to content

Commit 668f352

Browse files
committed
pre-commit fix
1 parent f99d5e3 commit 668f352

File tree

1 file changed

+26
-13
lines changed

1 file changed

+26
-13
lines changed

pcmdi_metrics/graphics/parallel_coordinate_plot/parallel_coordinate_plot_lib.py

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def parallel_coordinate_plot(
1818
models_to_highlight_by_line=True,
1919
models_to_highlight_colors=None,
2020
models_to_highlight_labels=None,
21-
models_to_highlight_markers=['s', 'o', '^', '*'],
21+
models_to_highlight_markers=["s", "o", "^", "*"],
2222
models_to_highlight_markers_size=10,
2323
fig=None,
2424
ax=None,
@@ -56,7 +56,7 @@ def parallel_coordinate_plot(
5656
- `data`: 2-d numpy array for metrics
5757
- `metric_names`: list, names of metrics for individual vertical axes (axis=1)
5858
- `model_names`: list, name of models for markers/lines (axis=0)
59-
- `models_to_highlight`: list, default=None, List of models to highlight as lines or marker
59+
- `models_to_highlight`: list, default=None, List of models to highlight as lines or marker
6060
- `models_to_highlight_by_line`: bool, default=True, highlight as lines. If False, as marker
6161
- `models_to_highlight_colors`: list, default=None, List of colors for models to highlight as lines
6262
- `models_to_highlight_labels`: list, default=None, List of string labels for models to highlight as lines
@@ -242,14 +242,19 @@ def parallel_coordinate_plot(
242242
label = models_to_highlight_labels[mh_index]
243243
else:
244244
label = model
245-
245+
246246
if models_to_highlight_by_line:
247247
ax.plot(range(N), zs[j, :], "-", c=color, label=label, lw=3)
248248
else:
249-
ax.plot(range(N), zs[j, :], models_to_highlight_markers[mh_index],
250-
c=color, label=label,
251-
markersize=models_to_highlight_markers_size)
252-
249+
ax.plot(
250+
range(N),
251+
zs[j, :],
252+
models_to_highlight_markers[mh_index],
253+
c=color,
254+
label=label,
255+
markersize=models_to_highlight_markers_size,
256+
)
257+
253258
mh_index += 1
254259
else:
255260
if identify_all_models:
@@ -300,20 +305,28 @@ def parallel_coordinate_plot(
300305
interpolate=False,
301306
alpha=0.5,
302307
)
303-
308+
304309
if arrow_between_lines:
305310
# Add vertical arrows
306311
for xi, yi1, yi2 in zip(x, y1, y2):
307-
if (yi2 > yi1):
312+
if yi2 > yi1:
308313
arrow_color = arrow_between_lines_colors[0]
309-
elif (yi2 < yi1):
314+
elif yi2 < yi1:
310315
arrow_color = arrow_between_lines_colors[1]
311316
else:
312317
arrow_color = None
313318
arrow_length = yi2 - yi1
314-
ax.arrow(xi, yi1, 0, arrow_length, color=arrow_color,
315-
length_includes_head=True,
316-
alpha=arrow_alpha, width=0.05, head_width=0.15)
319+
ax.arrow(
320+
xi,
321+
yi1,
322+
0,
323+
arrow_length,
324+
color=arrow_color,
325+
length_includes_head=True,
326+
alpha=arrow_alpha,
327+
width=0.05,
328+
head_width=0.15,
329+
)
317330

318331
ax.set_xlim(-0.5, N - 0.5)
319332
ax.set_xticks(range(N))

0 commit comments

Comments
 (0)