Skip to content

Commit 56d0bf1

Browse files
committed
updated figures
1 parent 21ed3d0 commit 56d0bf1

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

generate_figures.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def main():
117117

118118
# Create a figure with 2 subplots (one for each species)
119119
fig, axes = plt.subplots(
120-
1, 5, figsize=(20, 6)
120+
2, 3, figsize=(20, 6)
121121
) # Create a 2x3 grid of subplots
122122
axes = axes.flatten()
123123
colors = ["red", "green", "blue", "orange", "purple"]
@@ -139,20 +139,20 @@ def main():
139139
ax.set_ylim([0.0, 1.05])
140140
ax.set_xlabel("False Positive Rate" , fontsize=14)
141141
ax.set_ylabel("True Positive Rate" , fontsize=14 )
142-
ax.set_title(f"{species_title[idx].capitalize()}" , fontsize=14)
143-
ax.legend(loc="upper center", bbox_to_anchor=(0.5, -0.17), fontsize=12 )
142+
ax.set_title(f"${species_title[idx].capitalize()}$", fontsize=14)
143+
ax.legend(loc="lower right", fontsize=12 )
144144

145-
# axes[5].set_visible(False)
145+
axes[5].set_visible(False)
146146
fig.suptitle("ROC Curve for All Species w/ " + subplot_titles[k], fontsize=20)
147147
# Adjust layout to prevent overlap
148-
plt.tight_layout(rect=[0, 0.05, 1, 0.95]) # Adjust rect to accommodate legends
148+
plt.tight_layout() # Adjust rect to accommodate legends
149149
# Adjust the space between subplots
150150
plt.subplots_adjust(wspace=0.2)
151151
plt.savefig(Path("./results/images/", f"roc_{subplot_titles[k].lower().replace(" ", "_")}"))
152152
plt.show()
153153

154154
fig, axes = plt.subplots(
155-
1, 5, figsize=(20, 6)
155+
2, 3, figsize=(20, 6)
156156
) # Create a 2x3 grid of subplots
157157
axes = axes.flatten()
158158
colors = ["red", "green", "blue", "orange", "purple"]
@@ -174,16 +174,16 @@ def main():
174174
ax.set_ylim([0.0, 1.05])
175175
ax.set_xlabel("Recall" , fontsize=14)
176176
ax.set_ylabel("Precision", fontsize=14)
177-
ax.set_title(f"{species_title[idx].capitalize()}", fontsize=14)
178-
ax.legend(loc="upper center", bbox_to_anchor=(0.5, -0.17), fontsize=12 )
177+
ax.set_title(f"${species_title[idx].capitalize()}$", fontsize=14)
178+
ax.legend(loc="lower right", fontsize=12 )
179179

180-
# axes[5].set_visible(False)
180+
axes[5].set_visible(False)
181181
fig.suptitle(
182182
"Precision/Recall Curve for All Species w/ " + subplot_titles[k],
183183
fontsize=20,
184184
)
185185
# Adjust layout to prevent overlap
186-
plt.tight_layout(rect=[0, 0.05, 1, 0.95]) # Adjust rect to accommodate legends
186+
plt.tight_layout() # Adjust rect to accommodate legends
187187
# Adjust the space between subplots
188188
plt.subplots_adjust(wspace=0.2)
189189
plt.savefig(Path("./results/images/", f"pr_{subplot_titles[k].lower().replace(" ", "_")}"))
@@ -242,7 +242,7 @@ def main():
242242
final_rw_data[species][idx]["tpr"],
243243
color=colors[i],
244244
lw=2,
245-
label=f"{species_title[i]} (area = %0.2f)" % final_rw_data[species][idx]["roc"],
245+
label=f"${species_title[i]}$ (area = %0.2f)" % final_rw_data[species][idx]["roc"],
246246
)
247247

248248
ax.set_xlim([0.0, 1.0])
@@ -275,7 +275,7 @@ def main():
275275
final_rw_data[species][idx]["precision"],
276276
color=colors[i],
277277
lw=2,
278-
label=f"{species_title[i]} (area = %0.2f)" % final_rw_data[species][idx]["pr"],
278+
label=f"${species_title[i]}$ (area = %0.2f)" % final_rw_data[species][idx]["pr"],
279279
)
280280

281281
ax.set_xlim([0.0, 1.0])
33.1 KB
Loading
32.1 KB
Loading
30.3 KB
Loading
27.8 KB
Loading

results/images/rw_pr.png

-1.86 KB
Loading

results/images/rw_roc.png

-2.51 KB
Loading

0 commit comments

Comments
 (0)