Skip to content

Commit

Permalink
Sync colors
Browse files Browse the repository at this point in the history
  • Loading branch information
gevtushenko committed May 5, 2023
1 parent 4f90ac5 commit 4c5430a
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions benchmarks/scripts/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
from scipy.stats import mannwhitneyu
from scipy.stats.mstats import hdquantiles

default_colors = plt.rcParams['axes.prop_cycle'].by_key()['color']
color_cycle = itertools.cycle(default_colors)
color_map = {}

precision = 0.01
sensitivity = 0.5
Expand Down Expand Up @@ -312,6 +315,9 @@ def lowland_between(mode_candidate, left_peak, right_peak):


def hd_displot(samples, label, ax):
if label not in color_map:
color_map[label] = next(color_cycle)
color = color_map[label]
widths, heights = qrde_hd(samples)
mode_ids = extract_modes(samples)

Expand All @@ -335,10 +341,17 @@ def hd_displot(samples, label, ax):
xs = xs + [max_sample]
ys = ys + [0]

ax.plot(xs, ys, label=label)
ax.plot(peak_xs, peak_ys, 'o', color='red')
ax.fill_between(xs, ys, 0, alpha=0.4, color=color)

quartiles_of_interest = [0.25, 0.5, 0.75]

for quartile in quartiles_of_interest:
bin = int(quartile / precision) + 1
ax.plot([xs[bin], xs[bin]], [0, ys[bin]], color=color)

ax.plot(xs, ys, label=label, color=color)
ax.plot(peak_xs, peak_ys, 'o', color=color)
ax.legend()
ax.fill_between(xs, ys, 0, alpha=0.4)


def displot(data, ax):
Expand Down

0 comments on commit 4c5430a

Please sign in to comment.