Ich habe eine Frage darüber, wie Streudiagramm und Linie in einem Diagramm richtig platziert werden.Streudiagramm und Linie in Python
Hier ist der Code:
import numpy as np
import matplotlib.pyplot as plt
t= np.linspace(60, 180,100)
ax= plt.subplot()
ax.plot(data.Weight, data.Height , color = 'red')
ax.plot(t, 60+ 0.05*t, label=r"$Height = 60+ 0.05*Weight$")
ax.plot(t, 50+ 0.16*t, label=r"$Height = 50+ 0.16*Weight$")
ax.set_xlabel(r'$Weight$', fontsize=12)
ax.set_ylabel(r'$Height$', fontsize=12)
ax.set_title('Dependence')
plt.show()
Wie Streudiagramm zu sehen ist reflektieren nicht korrekt ist (es zeigt als Linien)
Thank you!