Spaces:
Running
on
Zero
Running
on
Zero
more finishing touches
Browse files
bytelatent/plotting/entropy_figure_via_matplot_lib.py
CHANGED
@@ -35,7 +35,14 @@ def plot_entropies(patch_lengths: torch.Tensor, scores: torch.Tensor, chars: str
|
|
35 |
for boundary in patch_boundaries[:-1]:
|
36 |
ax.axvline(x=boundary, color='grey', linestyle='--', linewidth=1)
|
37 |
|
38 |
-
ax.axhline(y=threshold, color='red', linestyle='--', linewidth=1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
# Set x-axis ticks and labels
|
41 |
ax.set_xticks(x_indices)
|
|
|
35 |
for boundary in patch_boundaries[:-1]:
|
36 |
ax.axvline(x=boundary, color='grey', linestyle='--', linewidth=1)
|
37 |
|
38 |
+
ax.axhline(y=threshold, color='red', linestyle='--', linewidth=1, )
|
39 |
+
ax.annotate(f'Entropy Threshold',
|
40 |
+
xy=(0.05, threshold), # Position of the line
|
41 |
+
xytext=(0.05, threshold + 0.1), # Text position
|
42 |
+
xycoords='axes fraction', # Use axes coordinates (0-1)
|
43 |
+
textcoords='data', # Use data coordinates for text
|
44 |
+
color='red'
|
45 |
+
)
|
46 |
|
47 |
# Set x-axis ticks and labels
|
48 |
ax.set_xticks(x_indices)
|