import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-100, 100, 1000)
y1 = x
y2 = x ** 2
y3 = 3 * x ** 3 + 5 * x ** 2 + 2 * x + 1
print(y1)
print(y2)
print(y3)
plt.plot(x, y1, 'o-r', label='y=x')
plt.plot(x, y2, 'o:g', label='y=$x^2$')
plt.plot(x, y3, 'o-.b', label='y=3*$x^3$+5*$x^2$+2*x+1')
plt.ylim(-1000, 1000)
plt.legend()
plt.show()
pandas中绘制图像,图像中带有x^2,可以表示出来
最新推荐文章于 2022-05-10 19:55:50 发布