@@ -158,58 +158,64 @@ def plot_data_quality_impact():
158158def plot_phi_geometry_impact_eso ():
159159 """
160160 Shows φ-geometry impact: 0% without → 99.1% Combined Validation
161- Updated 2025-12-07
161+ Updated 2025-12-07 - Fixed overlapping text
162162 """
163- fig , ax = plt .subplots (figsize = (12 , 8 ))
163+ fig , ax = plt .subplots (figsize = (14 , 9 ))
164164
165- categories = ['WITHOUT\n φ-Geometry\n (Complete failure) ' ,
166- 'WITH φ-Geometry\n + ESO Data\n (97.9%) ' ,
167- 'WITH φ-Geometry\n + Energy Framework\n (100%) ' ]
165+ categories = ['WITHOUT\n φ-Geometry' ,
166+ 'WITH φ-Geometry\n + ESO Data' ,
167+ 'WITH φ-Geometry\n + Energy Framework' ]
168168 win_rates = [0.0 , 97.9 , 100.0 ]
169169 colors = [COLORS ['failure' ], COLORS ['eso_primary' ], COLORS ['eso_perfect' ]]
170170
171+ # Narrower bars to leave more space
171172 bars = ax .bar (categories , win_rates , color = colors , alpha = 0.85 ,
172- edgecolor = 'black' , linewidth = 2 , width = 0.6 )
173+ edgecolor = 'black' , linewidth = 2 , width = 0.5 )
173174
174- # Add value labels
175- for bar , rate in zip (bars , win_rates ):
175+ # Add value labels INSIDE bars for high values, outside for low
176+ for i , ( bar , rate ) in enumerate ( zip (bars , win_rates ) ):
176177 height = bar .get_height ()
177- label = f'{ rate :.1f} %'
178178 if rate == 0 :
179- label += '\n (0 wins)'
179+ # Label below for 0%
180+ ax .text (bar .get_x () + bar .get_width ()/ 2 , 5 , '0.0%\n (0 wins)' ,
181+ ha = 'center' , va = 'bottom' , fontsize = 11 , fontweight = 'bold' )
180182 elif rate == 97.9 :
181- label += '\n (46/47 wins)'
183+ # Label inside bar
184+ ax .text (bar .get_x () + bar .get_width ()/ 2 , height - 15 , '97.9%\n (46/47)' ,
185+ ha = 'center' , va = 'top' , fontsize = 11 , fontweight = 'bold' , color = 'white' )
182186 else :
183- label += ' \n (64/64 systems)'
184- ax .text (bar .get_x () + bar .get_width ()/ 2 , height + 2 , label ,
185- ha = 'center' , va = 'bottom ' , fontsize = 12 , fontweight = 'bold' )
187+ # Label inside bar
188+ ax .text (bar .get_x () + bar .get_width ()/ 2 , height - 15 , '100.0% \n (64/64)' ,
189+ ha = 'center' , va = 'top ' , fontsize = 11 , fontweight = 'bold' , color = 'white ' )
186190
187- # Add arrows showing transitions
188- ax .annotate ('' , xy = (1 , 97.9 ), xytext = (0 , 0 ),
191+ # Arrow from 0 to ESO - positioned lower to avoid overlap
192+ ax .annotate ('' , xy = (1 , 70 ), xytext = (0 , 10 ),
189193 arrowprops = dict (arrowstyle = '->' , lw = 3 , color = COLORS ['gold' ]))
190- ax .text (0.5 , 49 , 'φ = (1+√5)/2\n Geometric Foundation ' ,
191- ha = 'center' , va = 'center' , fontsize = 11 , fontweight = 'bold' ,
194+ ax .text (0.5 , 35 , 'φ = (1+√5)/2' ,
195+ ha = 'center' , va = 'center' , fontsize = 10 , fontweight = 'bold' ,
192196 color = COLORS ['gold' ],
193197 bbox = dict (boxstyle = 'round' , facecolor = 'lightyellow' , alpha = 0.9 ))
194198
195- ax .annotate ('' , xy = (2 , 100 ), xytext = (1 , 97.9 ),
199+ # Arrow from ESO to Energy - positioned to avoid text
200+ ax .annotate ('' , xy = (2 , 85 ), xytext = (1 , 85 ),
196201 arrowprops = dict (arrowstyle = '->' , lw = 2 , color = 'darkgreen' ))
197- ax .text (1.5 , 90 , 'Energy Framework\n 129 objects' ,
198- ha = 'center' , va = 'center' , fontsize = 10 , fontweight = 'bold' ,
199- color = 'darkgreen' )
202+ ax .text (1.5 , 75 , '+129 objects' ,
203+ ha = 'center' , va = 'center' , fontsize = 9 , fontweight = 'bold' ,
204+ color = 'darkgreen' ,
205+ bbox = dict (boxstyle = 'round' , facecolor = 'white' , alpha = 0.8 ))
200206
201- # Styling
207+ # Styling - extended Y axis for more space
202208 ax .set_ylabel ('Overall Win Rate (%)' , fontsize = 14 , fontweight = 'bold' )
203- ax .set_title ('φ-Geometry is Fundamental:\n Transition from Failure to Breakthrough with Appropriate Data' ,
204- fontsize = 16 , fontweight = 'bold' , pad = 20 )
205- ax .set_ylim (- 5 , 110 )
209+ ax .set_title ('φ-Geometry is Fundamental:\n Transition from Failure to Breakthrough' ,
210+ fontsize = 16 , fontweight = 'bold' , pad = 15 )
211+ ax .set_ylim (- 5 , 130 ) # Extended to make room for top box
212+ ax .set_yticks ([0 , 20 , 40 , 60 , 80 , 100 ])
206213 ax .grid (axis = 'y' , alpha = 0.3 , linestyle = ':' , linewidth = 0.8 )
207214
208- # Add interpretation box
209- ax .text (0.5 , 0.98 , 'COMBINED VALIDATION: 99.1% (110/111 wins)\n '
210- 'φ-Geometry is FUNDAMENTAL: 0% without → 99.1% with' ,
211- transform = ax .transAxes , ha = 'center' , va = 'top' ,
212- fontsize = 12 , fontweight = 'bold' , bbox = dict (boxstyle = 'round' , facecolor = 'lightgreen' , alpha = 0.9 ))
215+ # Combined validation box at TOP - outside plot area
216+ ax .text (0.5 , 120 , 'COMBINED: 99.1% (110/111 wins)' ,
217+ ha = 'center' , va = 'center' , fontsize = 13 , fontweight = 'bold' ,
218+ bbox = dict (boxstyle = 'round' , facecolor = 'lightgreen' , alpha = 0.9 , pad = 0.5 ))
213219
214220 plt .tight_layout ()
215221 plt .savefig (output_dir / 'phi_geometry_impact_eso.png' , dpi = 300 , bbox_inches = 'tight' )
0 commit comments