带有 matplotlib 和 tkinter 的透明背景

问题描述

我正在为 whatsapp 聊天编写数据分析程序,我的 tkinter 窗口中有一个 matplotlib 图。我知道如何自定义颜色,但如何将背景设置为透明?

f = figure(figsize=(4.1,4.1),dpi=100)                                        
f.set_facecolor('xkcd:gray')                   # this should be transparent
a = f.add_subplot(111)
a.plot(dates,mes_count)
a.xaxis.set_major_locator(MaxNLocator(prune='both',nbins=6))
a.set_facecolor('xkcd:gray')

canvas = figureCanvasTkAgg(f,mainloop.root)                                    
canvas.get_tk_widget().place(x=190,y=80)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)