Matplotlib Plotly mpl到Plotly错误:&x27;脊柱';对象没有属性';像';

Matplotlib Plotly mpl到Plotly错误:&x27;脊柱';对象没有属性';像';,matplotlib,plotly-python,Matplotlib,Plotly Python,我有一个matplotlib图形,我想将其转换为plotly import matplotlib.pyplot as plt from plotly.tools import mpl_to_plotly fig = plt.figure() ## Lots of code to create my figure ## plotly_fig = mpl_to_plotly(fig) 我得到的错误是AttributeError:“Spine”对象没有属性“is_frame_like” 我认

我有一个matplotlib图形,我想将其转换为plotly

import matplotlib.pyplot as plt
from plotly.tools import mpl_to_plotly

fig = plt.figure()

## Lots of code to create my figure ##

plotly_fig = mpl_to_plotly(fig)

我得到的错误是AttributeError:“Spine”对象没有属性“is_frame_like”


我认为该函数非常简单,如何解决这个问题?

发生此错误是因为它调用Matplotlib中已删除的函数

Warning (from warnings module):
  File "C:\Program Files\Python36\lib\site-packages\plotly\matplotlylib\mpltools.py", line 368
    spine_frame_like = spine.is_frame_like()
MatplotlibDeprecationWarning: 
The is_frame_like function was deprecated in Matplotlib 3.1 and will be removed in 3.3.
在plotly的最新提交中,它仍然调用
is\u frame\u like()
函数。已经有一个跟踪此事件的程序。如果仍要使用
mpl\u to\u plotly()
函数,则可能需要选择降级Matplotlib

“阴谋组织”的一名成员在那期杂志上说

事实上,我们的matplotlib转换实用程序此时应被视为已弃用,因为它没有被积极维护以跟踪matplotlib本身的弃用和更改,因此它最适合使用较旧版本的matplotlib。我应该相应地更新文档字符串

与此同时,他声称

这就是说,如果有人想用它来更新它,我很乐意与他们一起集成这些更改:)


查看该期中的评论,Plotly似乎在考虑不推荐使用
mpl\u to_Plotly
。@nedned谢谢,我已经在我的回答中添加了这一点,以防有人不仔细看这个问题。