-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TclError when using pandastable with matplotlib figure #177
Comments
I don't know how to solve that. but when you plot from pandastable it creates a PlotViewer object called pf that you can access and plot to. Maybe that's of use. root = tkinter.Tk()
pane = tkinter.Canvas(root)
pdframe = pd.DataFrame()
table = Table(pane, dataframe=pdframe, showtoolbar=False, showstatusbar=True)
table.show()
table.plotSelected()
pf = table.pf
fig = pf.fig
ax = pf.ax
ax.plot(range(10),range(10))
pane.pack()
root.mainloop() |
@dmnfarrell Thanks a lot for the quick answer and the tip with table.pf object. I think that the error I am getting may be related to the fact that the |
Sorry I don't know how to do that. You'd have to ask someone who knows more about matplotlib. Maybe you could do it without using the pyplot interface. https://matplotlib.org/faq/usage_faq.html#matplotlib-pyplot-and-pylab-how-are-they-related |
I would like to use pandastable together with my own matplotlib figure. However, I get the following error:
_tkinter.TclError: image "pyimage10" doesn't exist
here is a minimal code example that reproduces the error:
without the line
fig = plt.figure()
the code works as expectedI was able to work around the problem by replacing
root = tkinter.Tk()
withroot = tkinter.Toplevel()
. See also this stackexchange question. However, this workaround causes other problems like the application not closing properly.This seems to indicate, that matplotlib creates a Tk root object in the background to which the
PhotoImage
objects inimages.py
get assigned. This makes the images inaccessible by pandastable in the other Tk root object.This answer on StackExchange suggests that adding
master=something
to thePhotoImage
objects inimages.py
might help. However, I am not sure which would be a good master object and how to pass it intoimages.py
.here is the full stack trace:
The text was updated successfully, but these errors were encountered: