发生异常: AttributeError Rectangle.set() got an unexpected keyword argument 'normed' File "E:\AIMath\Sy-3.1.py", line 10, in plot_binomial plt.hist(sample, bins=bins, align='left', normed=True, rwidth=0.1) # 绘制直方图 File "E:\AIMath\Sy-3.1.py", line 16, in <module> plot_binomial(10, 0.5) AttributeError: Rectangle.set() got an unexpected keyword argument 'normed'
时间: 2023-05-27 09:06:31 浏览: 47
这是一个异常,错误类型是 AttributeError,意思是 Rectangle.set() 函数接收到了一个意料之外的关键字参数 'normed'。详细信息显示错误发生在 E:\AIMath\Sy-3.1.py 文件的第 10 行,具体是在 plot_binomial 函数中的 plt.hist() 函数调用中,使用了参数 normed=True,而该函数不支持此参数。
相关问题
发生异常: AttributeError Rectangle.set() got an unexpected keyword argument 'normed' File "E:\AIMath\Sy-3.1.py", line 39, in <module> plt.hist(sample, bins=80, alpha=0.7, normed=True) # 绘制直方图 AttributeError: Rectangle.set() got an unexpected keyword argument 'normed'
这是一个异常错误,错误信息为:AttributeError Rectangle.set() got an unexpected keyword argument 'normed'。错误发生在文件路径为E:\AIMath\Sy-3.1.py的第39行,即在调用plt.hist()函数时传入了一个不被识别的关键字参数normed=True。
AttributeError: Rectangle.set() got an unexpected keyword argument 'normed'
这个错误可能是因为您使用的是过时的版本的Matplotlib。在较新的版本中,`set()`函数不再接受`normed`参数。您可以尝试更新Matplotlib版本或者在代码中使用`set_norm()`函数代替`set()`函数中的`normed`参数。另外,如果您能提供更多的代码和上下文信息,我可以更好地帮助您解决问题。
相关推荐
![py](https://img-home.csdnimg.cn/images/20210720083646.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)