[英]Plotting multiple y-values versus x using Matplotlib
I am trying to plot y1,y2,y3
all as a function of x
and show all the three on a single plot.我正在尝试将 plot y1,y2,y3
全部作为x
的 function 并在单个 plot 上显示所有三个。 But it is showing only two plots.但它只显示了两个情节。 I present the current output.我介绍当前的 output。
import matplotlib.pyplot as plt
import numpy as np
x=np.linspace(-1,0,10)
print(x)
y1=36.554+5.418*np.exp(-1.327*x)
y2=23.816+18.088*np.exp(-0.812*x)
y3=20.562+21.389*np.exp(-0.765*x)
print(y1,y2,y3)
plt.plot(x,y1,y2,y3)
The current output is当前的 output 是
Try this: plt.plot(x, y1, x, y2, x, y3)试试这个: plt.plot(x, y1, x, y2, x, y3)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.