matplotlib绘制3d图形出现空白,解决办法

如果出现如下图空白 
matplotlib绘制3d图形出现空白,解决办法_第1张图片
 

或者出现下面报错MatplotlibDeprecationWarning: Axes3D(fig) adding itself to the figure is deprecated since 3.4. Pass the keyword argument auto_add_to_figure=False and use fig.add_axes(ax) to suppress this warning. The default value of auto_add_to_figure will change to False in mpl3.5 and True values will no longer work in 3.6.  This is consistent with other Axes classes.

matplotlib绘制3d图形出现空白,解决办法_第2张图片

 

解决办法:matplotlib版本过高导致

pip install  matplotlib==3.3   -i https://mirrors.aliyun.com/pypi/simple/

如果遇到AttributeError: module 'backend_interagg' has no attribute 'FigureCanvas'错误需要在


import matplotlib.pyplot as plt
前面加上以下2行语句即可

import matplotlib
matplotlib.use('TkAgg')
 
 

你可能感兴趣的:(人工智能,深度学习,算法,matplotlib,3d,python,开发语言,机器学习)