Skip to content
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

Spurious warning calling fig.show() in jupyter inline backend #14171

Closed
dstansby opened this issue May 8, 2019 · 5 comments
Closed

Spurious warning calling fig.show() in jupyter inline backend #14171

dstansby opened this issue May 8, 2019 · 5 comments

Comments

@dstansby
Copy link
Member

dstansby commented May 8, 2019

Bug report

Bug summary

Using fig.show() in a notebook raises what seems like an un-needed warning. After calling plt.show() once, all subsequent calls to fig.show() don't raise the warning.

Code for reproduction

%matplotlib inline
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
fig.show()

Actual outcome

Plot is shown fine, but the following warning is raised:

/Users/dstansby/miniconda3/lib/python3.7/site-packages/matplotlib/figure.py:445: UserWarning: Matplotlib is currently using module://ipykernel.pylab.backend_inline, which is a non-GUI backend, so cannot show the figure.
  % get_backend())

Expected outcome

The figure is shown fine, so the warning seems unnecessary.

Matplotlib version

  • Operating system: MacOS
  • Matplotlib version: master branch
  • Matplotlib backend (print(matplotlib.get_backend())): module://ipykernel.pylab.backend_inline
  • Python version: 3.7.3
  • Jupyter version (if applicable): 4.4.0
@jstpierref
Copy link

Creating a placeholder for this backend to avoid the NoGUIException or simply continue using fig.show(warn=False). I am new here so let me know if it makes any sense.

@tacaswell tacaswell added this to the v3.2.0 milestone May 11, 2019
@tacaswell tacaswell added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Sep 5, 2019
@efiring efiring changed the title Spurious warning calling fig.show() in notebook backend Spurious warning calling fig.show() in jupyter inline backend Sep 10, 2019
@tacaswell tacaswell removed the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Sep 10, 2019
@tacaswell tacaswell modified the milestones: v3.2.0, needs sorting Sep 10, 2019
@milind-prajapat
Copy link

Exact same issue on windows as well

@tacaswell
Copy link
Member

I think the correct fix for this is for IPython to implement a no-op manager.show().

@github-actions
Copy link

This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

@github-actions github-actions bot added the status: inactive Marked by the “Stale” Github Action label Jun 16, 2023
@oscargus
Copy link
Contributor

I've opened an issue in ipython for this, so closing assuming that the comment from @tacaswell is indeed correct.

@oscargus oscargus closed this as not planned Won't fix, can't repro, duplicate, stale Jun 16, 2023
@QuLogic QuLogic removed the status: inactive Marked by the “Stale” Github Action label Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants