2

I am interested to know how ginput() of matplotlib works?When I run the following simple code

axis([-1, 1, -1, 1])
print( "Please click three times")
pts = ginput(3)

I get

:3: UserWarning: Matplotlib is currently using module://ipykernel.pylab.backend_inline, which is a non-GUI backend, so cannot show the figure. pts = ginput(3)

I am using matplotlib 3.3.3 and jupyter notebook with python 3.9.0

Fawad Nasim
  • 343
  • 2
  • 4
  • 10
  • 2
    Does this answer your question? [When I use matplotlib in jupyter notebook,it always raise " matplotlib is currently using a non-GUI backend" error?](https://stackoverflow.com/questions/37365357/when-i-use-matplotlib-in-jupyter-notebook-it-always-raise-matplotlib-is-curren) – kHarshit Dec 31 '20 at 04:41
  • Thanks , following isn't working for me ``` %pylab inline --------- Not working for me fig.show() ---------- Not using %matplotlib inline -------- not working ``` It worked matplotlib.use('TkAgg') – Fawad Nasim Dec 31 '20 at 04:47
  • Same problem here when running plot in a Jupyterlab notebook. Problem was caused by calling fig.show(), rather than just fig. – markling Jul 04 '22 at 09:33

0 Answers0