I have a question.
I have plotted a graph using Matplotlib like this:
from matplotlib import pyplot
import numpy
from scipy.interpolate import spline
widths = numpy.array([0, 30, 60, 90, 120, 150, 180])
heights = numpy.array([26, 38.5, 59.5, 82.5, 120.5, 182.5, 319.5])
xnew = numpy.linspace(widths.min(),widths.max(),300)
heights_smooth = spline(widths,heights,xnew)
pyplot.plot(xnew,heights_smooth)
pyplot.show()
Now I want to query a height value using width value as an argument. I cannot seem to find how to do that. Please help! Thanks in advance!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…