请帮我找出这条线的方程式是什么:
import matplotlib.pyplot as plt
import numpy as np
#start, stop, num (* is args [positional], ** is kwargs[keyword])
x = np.linspace(0, 2*np.pi, 400)
y = np.sin(x ** 2)
#this closes *args
plt.close('all')
#one figure and one subplot
f, ax = plt.subplots()
ax.plot(x,y)
ax.set_title("simple plot")
plt.xlabel('x-axis')
plt.ylabel('y-axis')
plt.show()
代码运行,并返回一个图形,但我无法计算出该图形的等式是什么。请帮助我,如果你能解释一下代码做了什么来绘制这个等式。我是python的新手。:)谢谢!
发布于 2018-10-25 15:58:36
x**2
在Python语言中表示x的2次方。在其他编程语言中,它通常被称为x^2
。所以你的函数是y = sin(x*x)
https://stackoverflow.com/questions/52993503
复制