Reputation: 417
I'm using the Jupyter notebook extension in VS Code. I'm using Camelot to extract tables from a pdf, and I'm trying to do some visual debugging to find the coordinates of the column separators.
When running:
camelot.plot(tables[1], kind='text').show()
I get the warning: "UserWarning: Matplotlib is currently using module://matplotlib_inline.backend_inline, which is a non-GUI backend, so cannot show the figure."
From https://pythonguides.com/matplotlib-is-currently-using-agg-a-non-gui-backend/ I understood the problem is I have no GUI backend. That website suggests using tkinter as the GUI backend.
So I did pip install tk
to install tkinter into my virtual environment. Then added import to my code: from tkinter import *
.
After closing the project folder, exiting VS Code and restarting, when I run
camelot.plot(tables[1], kind='text').show()
I get the same warning: "UserWarning: Matplotlib is currently using module://matplotlib_inline.backend_inline, which is a non-GUI backend, so cannot show the figure."
How do I get a GUI backend set up the way matplotlib wants?
Upvotes: 0
Views: 720
Reputation: 417
Seems there are various solutions, some of which are dated. A solution I found that works as of this post (2022) is
%matplotlib widget
That's it. Now I when I plot something, I get the usual static plot as well as an interactive plot that allows me to see x,y coordinates on the plot as I move the mouse around.
Upvotes: 1