Skip to content

Commit 1d2d595

Browse files
authored
Merge pull request #1335 from PCMDI/lee1043_parallel_coord_testing_20251021
Parallel coordinate plot bug fix
2 parents 496ea2d + 2b0f944 commit 1d2d595

File tree

2 files changed

+22
-124
lines changed

2 files changed

+22
-124
lines changed

pcmdi_metrics/graphics/parallel_coordinate_plot/parallel_coordinate_plot_example.ipynb

Lines changed: 14 additions & 124 deletions
Large diffs are not rendered by default.

pcmdi_metrics/graphics/parallel_coordinate_plot/parallel_coordinate_plot_lib.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ def parallel_coordinate_plot(
330330
group1_name: violin_colors[0],
331331
group2_name: violin_colors[1],
332332
},
333+
cut=0,
333334
)
334335

335336
# Line or marker
@@ -549,6 +550,13 @@ def _data_transform(
549550
ymeds = np.nanmedian(ys, axis=0) # median
550551
ymean = np.nanmean(ys, axis=0) # mean
551552

553+
# Convert to float type for further calculations
554+
ymaxs = ymaxs.astype(float)
555+
ymins = ymins.astype(float)
556+
ymeds = ymeds.astype(float)
557+
ymean = ymean.astype(float)
558+
559+
# Adjust vertical axis range to set center as median/mean/given number
552560
if vertical_center is not None:
553561
if vertical_center == "median":
554562
ymids = ymeds

0 commit comments

Comments
 (0)