绘制3d散点图报错ax = fig.gca(projection = ‘3d‘)TypeError: gca() got an unexpected keyword argument

 问题:使用matplotlib绘制3d散点图时报错ax = fig.gca(projection = '3d')
TypeError: gca() got an unexpected keyword argument 'projection'

解决:改成如下代码即可运行

ax = fig.add_subplot(projection = '3d')

你可能感兴趣的:(3d,matplotlib,python)