title: How to fix error: "matplotlib is currently using a non-GUI backend"
body: <p>I want to print a graph that updates itself automatically, when run on Spyder. I keep trying to use the matplotlib animation but every time after asking for inputs, instead of plotting the graph, it just shows:</p>
  
  <blockquote>
    <p>matplotlib is currently using a non-GUI backend, so cannot show the figure</p>
  </blockquote>
  
  <p>Am I doing something wrong in the code here?</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import matplotlib.animation as anim
  import math
  
  amp=int(input("Please Enter the amplitude-"))
  omeg=int(input("Please enter the angular frequency-"))
  phdiff=int(input("Please enter the phase difference-"))
  
  t=0
  
  fig=plt.figure()
  ax1=fig.add_subplot(111)
  
  def animate(i):
      global t
      y=amp*math.sin((omeg*t)+phdiff)
      fig.clear()
      ax1.plot(t,y)
      t+=1
  
  animated=anim.FuncAnimation(fig,animate,interval=1000)
  
  fig.show()
  </code></pre>