zl程序教程

您现在的位置是:首页 >  其它

当前栏目

成功解决AttributeError: Unknown property axisbg

解决 成功 Property unknown AttributeError
2023-09-14 09:04:51 时间

成功解决AttributeError: Unknown property axisbg

 

 

目录

解决问题

解决思路

解决方法


 

 

 

解决问题

    raise AttributeError('Unknown property %s' % k)
AttributeError: Unknown property axisbg

 

 

 

解决思路

引发属性错误(“未知属性%s”%k)
属性错误:未知属性axisbg

 

 

 

 

解决方法

在matplotlib.pyplot.subplot2grid()的属性栏里面已经没有了axisbg这个参数,根据matplotlib 2.2.0的API,
Color of Axes
The axisbg and axis_bgcolor properties on Axes have been deprecated in favor of facecolor.

得知,曾经包含的属性axisbg已经被facecolor所替换:
ax = plt.subplot2grid((2,1), (1,0), rowspan=4, colspan=4, facecolor=’#07000d’)
    同样的,matplotlib里面也去掉了 finance包,现在有个独立的库 mpl_finance,如果想用原来finance库中的函数,比如 candlestick_ochl,就需要从mpl_finance中导入了。

 

 

 

相关文章推荐

AttributeError: Unknown property axisbg