簡體   English   中英

“AttributeError: unexpected attribute 'plot_width' to figure, similar attributes are outer_width, width or min_width " with pandas_bokeh

[英]"AttributeError: unexpected attribute 'plot_width' to figure, similar attributes are outer_width, width or min_width " with pandas_bokeh

我正在嘗試使用pandas_bokeh創建帶有 pandas dataframe 的折線圖,我稱之為bucketed_df

import pandas_bokeh
pandas_bokeh.output_notebook()

bucketed_df.plot_bokeh(kind='line')

出於某種原因我得到了錯誤

AttributeError: unexpected attribute 'plot_width' to figure, similar attributes are outer_width, width or min_width

我不確定這是什么或如何修復它。 我正在使用 python 3.9 和 jupyter 筆記本

我在其上方的單元格中有一個 matplotlib 線圖。 我認為這可能存在一些問題。

此外,如果有人知道任何更好的交互式圖表,我願意切換到不同的庫。

我在最近安裝的 bokeh==3.0.1 上遇到了類似的錯誤。

如果我使用pip install --upgrade bokeh==2.4.3安裝版本 2.4.3(最新版本),錯誤就會消失

似乎 3.0.0 中有一個尚未解決的重大變化。 如果你有時間,請在https://github.com/bokeh/bokeh/issues發布這個問題。

臨時方式:

文件“.../lib/python3.10/site-packages/pandas_bokeh/plot.py”,第 439 行,位於 plot

添加

figure_options['width'] = figure_options['plot_width']
figure_options['height'] = figure_options['plot_height']
del figure_options['plot_width']
del figure_options['plot_height']

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM