title: UserWarning: Matplotlib is currently using agg, so cannot show the figure
body: <p>I'm trying to run a basic <code>matplotlib</code> example from the <a href="https://matplotlib.org/stable/gallery/lines_bars_and_markers/cohere.html#sphx-glr-gallery-lines-bars-and-markers-cohere-py" rel="nofollow noreferrer">official website</a>:</p>
  <p>However, when i run the code, my Python interpreter complains and outputs the following message:</p>
  <pre><code>UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
  plt.show()
  </code></pre>
  <p>I've installed <code>matplotlib</code> via <code>pip3 install matplotlib</code>.
  My current <code>python3</code> version is 3.9.1 and my OS is Ubuntu 20.04.</p>
  <p>I've already tried installing tkinter, as already described <a href="https://stackoverflow.com/questions/4783810/install-tkinter-for-python">here</a>, with no success.
  What should I do? Why is this happening?</p>