How I can get a point on the curve plotting when I have only one known Y-coordinate equation i.e. P = a * b (where a & b are defined values say 0.8,150) and x-coordinate is totally unknown and there is no equation linking x and y ( ex: y = mx +b; # i don't have this kind of equations). So, now the target is if say I have 'Y-coordinate' value as 120 and need to plot a point on the curve by taking distance or path from the unknown 'x-coordiante' value.
I tried the code as below
One sample figure about how I should plot
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import InterpolatedUnivariateSpline
# given values
y = np.array([0, 38.39, 71.41, 99.66, 123.67, 143.88, 160.61, 174.03, 184.16, 190.8, 193.52])
x = np.array([0, 0.37, 0.74, 1.11, 1.48, 1.85, 2.22, 2.59, 2.96, 3.33, 3.7])
x_val = np.linspace(0,7) #limts on x-axis
a = 0.8
b = 150
y_val = np.multiply(a, b)
yinterp = np.interp(x_val, x, y)
plt.plot(x, y, '-')
plt.plot(x_val, yinterp, 'o')
#here i need to plot a exact point w.r.t to y_val
#and also need to show the distance with a line from the selected x and y coordinates
plt.plot(x_val,y_val, '--')
plt.show()