This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author amiraliemami
Recipients amiraliemami
Date 2019-09-27.13:20:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1569590438.84.0.268389191233.issue38292@roundup.psfhosted.org>
In-reply-to
Content
TkInter variable classes don't link to a widget (tested on Checkbutton and Scale) if matplotlib.pyplot.set_cmap() function is called before the tkinter.Tk() call which instantiates the root of a TkInter GUI. There is no problem if it is called after this, though.

Simple example with checkbox attached below:

### Test program start ##############

import matplotlib.pyplot as plt
import tkinter as tk

plt.set_cmap('viridis') # <--- when placed here, breaks the variable
root = tk.Tk()
#plt.set_cmap('viridis') # <--- when placed here, everything is fine

# creation of variable class and widget
var = tk.BooleanVar()
tk.Checkbutton(root, variable=var).pack()

# for printing result
def on_click():
    print(var.get())
tk.Button(root, text="Print State to Console", command=on_click).pack()

root.mainloop()
History
Date User Action Args
2019-09-27 13:20:38amiraliemamisetrecipients: + amiraliemami
2019-09-27 13:20:38amiraliemamisetmessageid: <1569590438.84.0.268389191233.issue38292@roundup.psfhosted.org>
2019-09-27 13:20:38amiraliemamilinkissue38292 messages
2019-09-27 13:20:38amiraliemamicreate