Hi Renzo,
Thank you for the clarification.
I re-ran the codes and I don’t have the problem that you are facing. Could you please make sure the following code snippet is correct in your implementation because this is where the Ellipse is drawn.
ellipse = patches.Ellipse(xy=(centerpoint[0], centerpoint[1]), width=lambda_[0]*np.sqrt(cutoff)*2, height=lambda_[1]*np.sqrt(cutoff)*2, angle=np.rad2deg(np.arccos(v[0, 0])), edgecolor=’#fab1a0')
print(f”Center point x: {centerpoint[0]}”)
print(f”Center point y: {centerpoint[1]}”)
print(f”Width: {lambda_[0]*np.sqrt(cutoff)*2}”)
print(f”Height: {lambda_[1]*np.sqrt(cutoff)*2}”)
print(f”Angle: {np.rad2deg(np.arccos(v[0, 0]))}”)
values I got:
Center point x: 42.12931034482759
Center point y: 77.87068965517241
Width: 164.85105118698965
Height: 32.55925360676671
Angle: 11.822360428310446
And also please make sure that you dropped missing values from the dataset.