Skip to content

import matplotlib.pyplot as plt in axis_artist.py #10401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

cclauss
Copy link

@cclauss cclauss commented Feb 8, 2018

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./lib/mpl_toolkits/axisartist/axis_artist.py:1624:11: F821 undefined name 'plt'
    fig = plt.figure(1)
          ^
./lib/mpl_toolkits/axisartist/axis_artist.py:1653:5: F821 undefined name 'plt'
    plt.draw()
    ^
./lib/mpl_toolkits/axisartist/axis_artist.py:1660:11: F821 undefined name 'plt'
    fig = plt.figure(1)
          ^
./lib/mpl_toolkits/axisartist/axis_artist.py:1678:5: F821 undefined name 'plt'
    plt.draw()
    ^

@tacaswell
Copy link
Member

👎 This module definitely should not depend on pyplot.

These usages look like they are in some test functions at the bottom that are moved as part of #7545 .

Thank you for the work @cclauss , but I think this should be closed without merging.

Copy link
Member

@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this module should not depend on pyplot, the usage is in test functions at the bottom.

@cclauss cclauss force-pushed the import-matplotlib.pyplot-as-plt branch from 441d5aa to ca25d1e Compare February 8, 2018 23:09
@cclauss
Copy link
Author

cclauss commented Feb 8, 2018

Move the import down into those functions that actually access plt.

@QuLogic
Copy link
Member

QuLogic commented Feb 8, 2018

I agree with @tacaswell and don't think we should move forward with this, but I'm somewhat biased as I opened #7545 😉.

@cclauss
Copy link
Author

cclauss commented Feb 8, 2018

Closing in favor of #7545 by popular request.

@cclauss cclauss closed this Feb 8, 2018
@cclauss cclauss deleted the import-matplotlib.pyplot-as-plt branch February 8, 2018 23:51
@tacaswell
Copy link
Member

Thanks @cclauss. Even though we did not merge this we still appreciate the effort!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants