Skip to content

Commit

Permalink
update p-value text
Browse files Browse the repository at this point in the history
  • Loading branch information
EdoardoChidichimo authored Jun 26, 2024
1 parent 463a28f commit 46633bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hyperit/hyperit.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,8 @@ def __plot_matrix(self, results: np.ndarray, epoch: int, title: str, global_max:
value = self._it_matrix[epoch, i, j, 0] if epoch is not None else self._it_matrix[i, j, 0]
normalised_value = (value - np.min(results)) / (np.max(results) - np.min(results))
text_colour = 'white' if normalised_value > 0.5 else 'black'
plt.text(j, i, f'p={p_val:.2f}', ha='center', va='center', color=text_colour, fontsize=8, fontweight='bold')
p_value_text = 'p<0.01' if p_val < 0.01 else f'p={p_val:.2f}'
plt.text(j, i, p_value_text, ha='center', va='center', color=text_colour, fontsize=8, fontweight='bold')


cbar = plt.colorbar(img)
Expand Down

0 comments on commit 46633bb

Please sign in to comment.