@@ -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 ])
0 commit comments