@@ -152,8 +152,8 @@ def denormalize(self, norm_x, norm_y, target_pos=None):
152152 def fit_and_visualize (self ):
153153 plt .figure (figsize = (10 , 8 ))
154154
155- plt .plot (self .xs , self .ys , 'k.' , label = ' Samples' , alpha = 0.5 )
156- plt .axis (' equal' )
155+ plt .plot (self .xs , self .ys , "k." , label = " Samples" , alpha = 0.5 )
156+ plt .axis (" equal" )
157157 plt .grid (True , alpha = 0.3 )
158158
159159 # Invert plot Y axis to match screen coordinates
@@ -169,24 +169,31 @@ def fit_and_visualize(self):
169169 el_x = self .center [0 ] + scaled_axes [0 ] * np .cos (t )
170170 el_y = self .center [1 ] + scaled_axes [1 ] * np .sin (t )
171171
172- plt .plot (el_x , el_y , 'b-' , linewidth = 2 , label = 'Axis-Aligned Fit' )
173- plt .plot (self .center [0 ], self .center [1 ], 'r+' , markersize = 15 , label = 'Center' )
174-
175- plt .hlines (self .center [1 ],
176- self .center [0 ] - scaled_axes [0 ],
177- self .center [0 ] + scaled_axes [0 ],
178- colors = 'g' , linestyles = '-' , label = 'Width (X)' )
179-
180- plt .vlines (self .center [0 ],
181- self .center [1 ] - scaled_axes [1 ],
182- self .center [1 ] + scaled_axes [1 ],
183- colors = 'm' , linestyles = '-' , label = 'Height (Y)' )
184-
185- plt .title (f'Axis-Aligned Calibration (FlipX={ self .flip_x } )' )
172+ plt .plot (el_x , el_y , "b-" , linewidth = 2 , label = "Axis-Aligned Fit" )
173+ plt .plot (self .center [0 ], self .center [1 ], "r+" , markersize = 15 , label = "Center" )
174+
175+ plt .hlines (
176+ self .center [1 ],
177+ self .center [0 ] - scaled_axes [0 ],
178+ self .center [0 ] + scaled_axes [0 ],
179+ colors = "g" ,
180+ linestyles = "-" ,
181+ label = "Width (X)" ,
182+ )
183+
184+ plt .vlines (
185+ self .center [0 ],
186+ self .center [1 ] - scaled_axes [1 ],
187+ self .center [1 ] + scaled_axes [1 ],
188+ colors = "m" ,
189+ linestyles = "-" ,
190+ label = "Height (Y)" ,
191+ )
192+
193+ plt .title (f"Axis-Aligned Calibration (FlipX={ self .flip_x } )" )
186194 else :
187195 plt .title ("Fit FAILED" )
188196
189197 plt .legend ()
190198 plt .tight_layout ()
191199 plt .show ()
192-
0 commit comments