How to use Axes3D from matplotlib directly in standard plot to avoid flake8 error
When using a typical 3D plot:
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.gca(projection='3d')
flake8
reports the expected error:
./tools.py:62:9: F401 'mpl_toolkits.mplot3d.Axes3D' imported but unused
I know it can be avoided by using a comment # NOQA
. But is there another way to formulate the projection in the picture so that the Axes3D object is used?
+3
source to share