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

Masoud
  • 21
  • 1
  • 9
  • 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 :) – MSeifert Aug 18 '17 at 12:31

0 Answers0