为什么这些情节看起来很模糊" TkAgg"视网膜屏幕上的后端?

时间:2018-02-07 01:32:21

标签: python macos matplotlib tkinter

我使用matplotlib在使用tkinter完成的GUI应用程序中显示绘图。我注意到Mac Book Pro的视网膜屏幕上看起来很模糊。

以下是重现我的问题的最小示例。我为什么要使用" TkAgg"模糊的情节?后端?有办法解决这个问题吗?

MacOS 10.13.2,Python版本:3.6.4,Matplotlib版本:2.1.2,tkinter.TkVersion:8.5。

请注意默认" MacOSX"后端产生漂亮的锐利情节。此外,如果我创建一个tkinter应用程序,其他元素,如标签,菜单也很清晰,只有情节模糊。

import matplotlib
matplotlib.use('TkAgg') # Remove this to compare with MacOSX backend
import matplotlib.pyplot as plt

f = plt.figure(figsize=(6, 4))
a = f.add_subplot(111)
a.plot([1,2,3,4])
plt.show()

matplotlib tkinter plots look blurry on retina screen

0 个答案:

没有答案
相关问题