Plotly mpl_to_plotly error: 'Spine' object has no attribute 'is_frame_like'
Plotly mpl_to_plotly error: 'Spine' object has no attribute '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' object has no attribute '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 packages/python/plotly/plotly/matplotlylib/mpltools.py line 368, it still calls is_frame_like()
function. There is already an issue 的最新提交中对此进行跟踪。如果您仍想使用 mpl_to_plotly()
功能,您可能需要选择降级 Matplotlib。
nicolaskruchten,Plotly组织成员,在那一期中说
Indeed, our matplotlib conversion utility should be considered deprecated at this point as it isn’t being actively maintained to track deprecations and changes in matplotlib itself so it works best with older versions of matplotlib. I should update the docstrings accordingly.
与此同时,他声称
That said, if someone wants to work on it to bring it back up to date I’d be happy to work with them to integrate the changes :)
我有一个 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' object has no attribute '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 packages/python/plotly/plotly/matplotlylib/mpltools.py line 368, it still calls is_frame_like()
function. There is already an issue 的最新提交中对此进行跟踪。如果您仍想使用 mpl_to_plotly()
功能,您可能需要选择降级 Matplotlib。
nicolaskruchten,Plotly组织成员,在那一期中说
Indeed, our matplotlib conversion utility should be considered deprecated at this point as it isn’t being actively maintained to track deprecations and changes in matplotlib itself so it works best with older versions of matplotlib. I should update the docstrings accordingly.
与此同时,他声称
That said, if someone wants to work on it to bring it back up to date I’d be happy to work with them to integrate the changes :)