Reputation: 147
Im just trying to work out how to draw the lines as outlined in the picture below. I'm reading through W3Scools polynomial regression and I can't work out how to replicate the highlighted point on the curve with the horizontal and vertical orange lines.
Is it just a simple case of drawing the lines in or is there a matplotlib function that does this for you?
Upvotes: 1
Views: 637
Reputation: 1094
How about just plotting it as a line.
x_coord = # x value you want to highlight
y_coord = # y value you want to highlight
x_highlighting = [0, x_coord, x_coord]
y_highlighting = [y_coord, y_coord, 0]
plt.plot(x_highlighting, y_highlighting)
Upvotes: 2