为什么我的matplotlib图会生成gtk-关键误差?
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
x = np.arange(0, 10, 0.1)
y = np.sin(x)
plt.plot(x, y)
fig.savefig('saved_figure.png')
每当我尝试生成基本matplotlib图作为png时,我都会出现错误:
(test.py:26168): Gtk-CRITICAL **: 15:14:27.436: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
(test.py:26168): Gtk-CRITICAL **: 15:14:27.436: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
(test.py:26168): Gtk-CRITICAL **: 15:14:27.436: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
Segmentation Fault
如果很重要,我认为我的服务器是Solaris 10
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
x = np.arange(0, 10, 0.1)
y = np.sin(x)
plt.plot(x, y)
fig.savefig('saved_figure.png')
Whenever I try to generate a basic matplotlib graph as a png I get the error:
(test.py:26168): Gtk-CRITICAL **: 15:14:27.436: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
(test.py:26168): Gtk-CRITICAL **: 15:14:27.436: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
(test.py:26168): Gtk-CRITICAL **: 15:14:27.436: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
Segmentation Fault
If it matters I think my server is a Solaris 10
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
相同的解决方案与:
最大的答案解决了
强制matplotlib不使用任何Xwindow后端。
same solution as:
Generating a PNG with matplotlib when DISPLAY is undefined
the top answer which solved
Force matplotlib to not use any XWindow backend.