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

Patch for Parallel plot #1000

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Next Next commit
more options added for legend box control
  • Loading branch information
lee1043 committed Nov 21, 2023
commit eff9e7a30a99cc66e3074d9ec53744f9708b36dd
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def parallel_coordinate_plot(
colormap="viridis",
num_color=20,
legend_off=False,
legend_ncol=6,
legend_bbox_to_anchor=(0.5, -0.14),
logo_rect=None,
logo_off=False,
model_names2=None,
Expand Down Expand Up @@ -77,6 +79,8 @@ def parallel_coordinate_plot(
- `colormap`: string, default='viridis', matplotlib colormap
- `num_color`: integer, default=20, how many color to use.
- `legend_off`: bool, default=False, turn off legend
- `legend_ncol`: integer, default=6, number of columns for legend text
- `legend_bbox_to_anchor`: tuple, defulat=(0.5, -0.14), set legend box location
- `logo_rect`: sequence of float. The dimensions [left, bottom, width, height] of the new Axes.
All quantities are in fractions of figure width and height. Optional.
- `logo_off`: bool, default=False, turn off PMP logo
Expand Down Expand Up @@ -336,7 +340,8 @@ def parallel_coordinate_plot(
ax.set_title(title, fontsize=18)

if not legend_off:
ax.legend(loc="upper center", ncol=6, bbox_to_anchor=(0.5, -0.14))
#ax.legend(loc="upper center", ncol=6, bbox_to_anchor=(0.5, -0.14))
ax.legend(loc="upper center", ncol=legend_ncol, bbox_to_anchor=legend_bbox_to_anchor)

if not logo_off:
fig, ax = add_logo(fig, ax, logo_rect)
Expand Down Expand Up @@ -396,7 +401,7 @@ def _data_transform(
else:
ymins = np.repeat(ymin, N)

ymeds = np.nanmedian(ys, axis=0) # median
ymeds = np.nanmedian(ys, axis=0) # median
ymean = np.nanmean(ys, axis=0) # mean

if vertical_center is not None:
Expand Down