Skip to content

Commit

Permalink
Minor edits to enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
yoelcortes authored Jun 21, 2024
1 parent 8562aa8 commit 3845c99
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions biosteam/plots/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,8 +662,9 @@ def plot_spearman_2d(rhos, top=None, name=None, color_wheel=None, index=None,
Spearman's rank correlation coefficients to be plotted.
top=None : float, optional
Number of parameters to plot (from highest values).
color_wheel=None: list, optional
Iterable, either (A) of color objects with attribute 'RGBn' giving tuples of RGBn values, or (B) of tuples of RGBn values.
color_wheel=None: Iterable, optional
Iterable of colorpalette.Color objects or RGBn values.
Returns
-------
fig : matplotlib Figure
Expand All @@ -688,12 +689,10 @@ def plot_spearman_2d(rhos, top=None, name=None, color_wheel=None, index=None,
if not color_wheel: color_wheel = CABBI_colors.wheel()
fig, ax = plt.subplots()
for i, rho in enumerate(rhos):
if isinstance(color_wheel[N - i - 1], tuple):
plot_spearman_1d(rho, color=color_wheel[N - i - 1], s=s, offset=i,
fig=fig, ax=ax, style=False, sort=False, top=None)
else:
plot_spearman_1d(rho, color=color_wheel[N - i - 1].RGBn, s=s, offset=i,
fig=fig, ax=ax, style=False, sort=False, top=None)
color = color_wheel[N - i - 1]
if hasattr(color, 'RGBn'): color = color.RGBn
plot_spearman_1d(rho, color=color, s=s, offset=i,
fig=fig, ax=ax, style=False, sort=False, top=None)
# Plot central line
yranges = [(s/2 + s*i - 1., 1.) for i in range(len(rhos[0]))]
format_spearman_plot(ax, index, name, yranges, xlabel)
Expand Down

0 comments on commit 3845c99

Please sign in to comment.