添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

flake8 reports the expected error:

./tools.py:62:9: F401 'mpl_toolkits.mplot3d.Axes3D' imported but unused

I know it can be avoided using the # NOQA comment. But is there a different way to formulate the projection in the figure so that the Axes3D object is used?

If this is only about actually using the import at least once, you can do

ax = fig.gca(projection=Axes3D.name)

as "3d" is the name of the Axes3D class by which it is registered to the projection list.

Would this be how it is intended to be used, or is it a coincidence that the projection list and class name both use the string 3d? – Jonathan Holvey Jun 18, 2018 at 1:43 @Jonathan Holvey The projection list contains all registered classes' names. Hence Axes3D.name is exactly what to put there if an Axes3D is to be created. – ImportanceOfBeingErnest Jun 18, 2018 at 9:03

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.