Skip to content

Commit

Permalink
updated figures
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlaltaf committed Sep 20, 2024
1 parent 21ed3d0 commit 56d0bf1
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions generate_figures.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def main():

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

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

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

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

ax.set_xlim([0.0, 1.0])
Expand Down Expand Up @@ -275,7 +275,7 @@ def main():
final_rw_data[species][idx]["precision"],
color=colors[i],
lw=2,
label=f"{species_title[i]} (area = %0.2f)" % final_rw_data[species][idx]["pr"],
label=f"${species_title[i]}$ (area = %0.2f)" % final_rw_data[species][idx]["pr"],
)

ax.set_xlim([0.0, 1.0])
Expand Down
Binary file modified results/images/pr_complete_inferred_networks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/images/pr_complete_non_inferred_networks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/images/roc_complete_inferred_networks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/images/roc_complete_non_inferred_networks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/images/rw_pr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified results/images/rw_roc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 56d0bf1

Please sign in to comment.