How can I set an image (a palplot created with seaborn) into a Customtkinter button (CTkButton)?
In the following MWE, I created the button and the image but adding the image with image = image in the button definition does not work.
MWE
root = CTk()
# Create figure
image = plt.Figure()
ax = image.add_subplot()
# Create canvas to hold figure
canvas = FigureCanvasTkAgg(image, master=root)
canvas.get_tk_widget().grid(column=0, row=1)
ax.imshow(np.arange(500).reshape(1, 500),
cmap=matplotlib.colors.ListedColormap(list(color_palette("flare", 500))),
aspect="auto")
canvas.draw_idle()
# Create button
button = CTkButton(root, text="some button with an image", image = image)
button.grid(column=0, row=0)
root.mainloop()
