如何在标准绘图中直接使用matplotlib中的Axes3D避免flake8

2024-04-18 06:04:56 发布

您现在位置:Python中文网/ 问答频道 /正文

使用典型的三维绘图时:

from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.gca(projection='3d')

flake8报告预期错误:

^{pr2}$

我知道使用# NOQA注释是可以避免的。但是,有没有不同的方法来表示图形中的投影,以便使用Axes3D对象?在


Tags: fromimport绘图matplotlibasfigpltax