| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -230,24 +230,54 @@ def switch_backend(newbackend): | |
| _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup() | ||
|
|
||
|
|
||
| def show(*args, **kw): | ||
| def show(block=None): | ||
| """ | ||
| Display a figure. | ||
| When running in ipython with its pylab mode, display all | ||
| figures and return to the ipython prompt. | ||
| Draw and display all figures. | ||
|
|
||
| In non-interactive mode, display all figures and block until | ||
| the figures have been closed; in interactive mode it has no | ||
| effect unless figures were created prior to a change from | ||
| non-interactive to interactive mode (not recommended). In | ||
| that case it displays the figures but does not block. | ||
| Mainly used in non-interactive mode to draw and display | ||
| the figures. It usually does nothing in interactive mode. | ||
|
|
||
| A single experimental keyword argument, *block*, may be | ||
| set to True or False to override the blocking behavior | ||
| described above. | ||
| Parameters | ||
| ---------- | ||
|
|
||
| block : bool or None | ||
| True means that the execution is blocked until the figures are closed | ||
|
Comment thread
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityCan be shortend: "Whether the execution is blocked until the figures are closed."
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityAlternative suggestion:
Sorry, something went wrong.
All reactions
|
||
| and False means that the python execution continues after the figures | ||
| are displayed. | ||
|
|
||
| The default behavior is different in interactive and non-interactive | ||
|
Comment thread
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityShorter: The default is True unless interactive mode is enabled or %matplotlib_ is used in IPython.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityWouldn't want to go for the long version here. It's just redundant and doesn't add to the clarity.
Sorry, something went wrong.
All reactions
|
||
| mode and whether or not `%matplotlib`_ is used in IPython. The default | ||
| is False in interactive mode and True in non-interactive mode except | ||
| when `%matplotlib`_ has been used in IPython, it is False in that case. | ||
|
|
||
| Notes | ||
| ----- | ||
| Blocking is necessary when running ``python script.py`` to be able to see | ||
| the figures before the python session finish but blocking is often not the | ||
| expected behavior when running Python interactively. | ||
|
|
||
| The difference between non-interactive and interactive mode is that the | ||
| figures are drawn and updated automatically after each plot command in | ||
| interactive mode. | ||
|
|
||
| Interactive mode can be set on and off with `.pyplot.ion` and | ||
| `.pyplot.ioff` in both vanilla Python and IPython and set to on with | ||
| `%matplotlib`_ in IPython. | ||
|
|
||
| .. _`%matplotlib`: | ||
| http://ipython.readthedocs.io/en/stable/interactive/plotting.html#id1 | ||
|
|
||
| See Also | ||
| -------- | ||
| .pyplot.ion | ||
| .pyplot.ioff | ||
| .pyplot.isinteractive | ||
| """ | ||
| global _show | ||
| return _show(*args, **kw) | ||
| if block is not None: | ||
| if type(block) != bool: | ||
| raise TypeError('"block" should be a bool or None') | ||
| return _show(block=block) | ||
|
|
||
|
|
||
| def isinteractive(): | ||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityWhy would it not do anything in interactive mode? I think it also shows the figure there.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityI am not sure. It was written in the old docstring that it does nothing.
When I test it in spyder, the only difference is that the "thumbnail" in the toolbar start to blink if plt.show() is used. The figure window don't pop up to the front or something like that.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.