AttributeError:未知属性axisbg [英] AttributeError: Unknown property axisbg

查看:206
本文介绍了AttributeError:未知属性axisbg的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我要运行的代码:

Here is a code am trying to run:

ax = plt.axes(axisbg='#E6E6E6')
ax.set_axisbelow(True)
plt.grid(color='w',linestyle='solid')

for spine in ax.spines.values():
   spine.set_visible(False)

ax.xaxis.tick_bottom()
ax.yaxis.tick_left()

ax.tick_params(colors='gray',direction='out')
for tick in ax.get_xticklabels():
   tick.set_color('gray')
for tick in ax.get_yaxislabels():
   tick.set_color('gray')

ax.hist(x,edgecolor='E6E6E6',color='E6E6E6');

错误是:AttributeError:未知属性axisbg

And the Error is: AttributeError: Unknown property axisbg

请帮助我确定错误.

推荐答案

替换下面的代码行

ax = plt.axes(axisbg='#E6E6E6')

ax = plt.axes(facecolor='#E6E6E6')

这篇关于AttributeError:未知属性axisbg的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆