Skip to content

Commit

Permalink
update colour bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Edoardo Chidichimo committed Apr 27, 2024
1 parent f68c7fc commit 4409ee8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions hyperit/hyperit.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,10 +714,12 @@ def __plot_it(self) -> None:

cbar = plt.colorbar(img)
cbar.set_label(self._measure_title, rotation=270, labelpad=20)
ticks = list(cbar.get_ticks())
if global_max not in ticks:
ticks.append(global_max)
ticks = sorted(set(ticks))
n_ticks = 8
ticks = np.linspace(0, global_max, n_ticks)
# ticks = list(cbar.get_ticks())
# if global_max not in ticks:
# ticks.append(global_max)
# ticks = sorted(set(ticks))
cbar.set_ticks(ticks)
cbar.set_ticklabels([f"{tick:.2f}" if tick != global_max else f"{tick:.2f} (max)" for tick in ticks])

Expand Down

0 comments on commit 4409ee8

Please sign in to comment.