2

I am trying to plot y1,y2,y3 all as a function of x and show all the three on a single plot. But it is showing only two plots. I present the current 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

1 Answer 1

4

Try this:

plt.plot(x, y1, x, y2, x, y3)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.