X Tutup
Skip to content

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

Closed
cclauss wants to merge 1 commit intomatplotlib:masterfrom
cclauss:import-matplotlib.pyplot-as-plt
Closed

import matplotlib.pyplot as plt in axis_artist.py#10401
cclauss wants to merge 1 commit intomatplotlib:masterfrom
cclauss:import-matplotlib.pyplot-as-plt

Conversation

@cclauss
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Author

cclauss commented Feb 8, 2018

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

@QuLogic
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

X Tutup