1

Here is my code :

import matplotlib.pyplot as plt
import numpy as np
from time import sleep
c = np.arange(-5,5,0.1)
pi = np.pi
x = np.arange(-pi,pi,0.01)
plt.figure()
for ci in c:
    y = np.sin(ci*x)
    plt.plot(x,y)
    plt.show()
    sleep(1)

Currently the plots are not shown together.It shows figure and I should close that figure to show another. What should I do to show the plots respectively in one figure?
Edit:
I want to see in one figure and doesn't show previous plot I did this with Matlab but I can't do with python

1
  • 2
    Welcome to StackOverflow. I closed your question because I think it has already been asked + answered but in case the duplicate doesn't work please update your question to reflect why the duplicate didn't work (best with examples) and ping me again. Asking a duplicate is not a bad thing and there is no penalty for you (so don't consider it a punishment!). But I really think the duplicate will solve your issue :) Commented Aug 18, 2017 at 12:31

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.