Skip to content

Commit

Permalink
Tweaks to heatmap
Browse files Browse the repository at this point in the history
  • Loading branch information
mariya committed Nov 27, 2024
1 parent e7a6221 commit 9b9c4ce
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/conformist/prediction_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ def _sort_class_names_by_palette(self, class_names, custom_color_palette):

def visualize_class_counts_by_dataset(self,
primary_class_only=False,
custom_color_palette=None):
custom_color_palette=None,
legend_top_padding=0.125):
plt.figure()

# create a bar chart
Expand Down Expand Up @@ -311,7 +312,7 @@ def visualize_class_counts_by_dataset(self,
loc='lower center',
frameon=False,
ncol=len(legend_handles)/4,
bbox_to_anchor=(0.5, -0.125), # Adjust position: (x, y)
bbox_to_anchor=(0.5, 0-legend_top_padding), # Adjust position: (x, y)
handletextpad=1, # Increase padding between legend handle and text
columnspacing=8 # Increase spacing between columns
)
Expand Down Expand Up @@ -450,9 +451,10 @@ def visualize_prediction_heatmap(self, min_softmax_threshold=0.5):
# Remove y ticks
hm2.set_yticks([])

# Remove x label
hm2.set_xlabel(r"$\overline{\mathrm{FP}}$",
weight='bold')
# Add label
hm2.set_xlabel("mean softmax\nfalse positive",
weight='bold',
rotation=90)

# Remove x ticks
hm2.set_xticks([])
Expand Down

0 comments on commit 9b9c4ce

Please sign in to comment.