-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC: Start to document interactive figures #4779
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
Conversation
Btw I think issue #4732 should be addressed first. |
@mdehoon Have you had a chance to look at the updated text? |
doc/users/interactive_guide.rst
Outdated
graphs. | ||
|
||
This page is meant to be a rapid introduction to the relevant details of | ||
integrating the matplotlib with a GUI event loop. |
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.
Maybe add the reference: "For further details see: http://www.amazon.com/Interactive-Applications-using-Matplotlib-Benjamin/dp/1783988843?"
doc/users/interactive_guide.rst
Outdated
even with matplotlib in 'interactive mode', may not work in the | ||
vanilla python repl if an appropriate `PyOS_InputHook` is not | ||
registered. We suggest using ``IPython``, which in addition to | ||
improving the command line, ensures that such a `PyOS_InptuHook` |
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.
(sp)
I'm not going to let this hold up 1.5.0 -- as it's doc only, it's low cost to just put it in 1.5.1. |
I don't think this is required to be on 2.0. |
fde979f
to
61a194b
Compare
@QuLogic I think I got all of your comments |
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.
Is this still WIP?
In principle this is good to go, but I am not a great writer... |
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
:template: autosummary.rst | ||
:nosignatures: | ||
|
||
pyplot.show |
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.
Was there a reason for having these two separately from the above?
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.
I was trying to group ion
, ioff
, isinteractive
as a "family" that queries and modifies the state of interactive mode and these two as a "family" that may run the GUI event loop. I'm not sure if it works as well in practice as it does in my head.
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.
It's a logical distinction; is it worth preceding each group with a concise statement of what makes it a family?
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
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.
I suppose we can leave this till Monday or whenever we tag 3.3 rc.
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
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.
Partial review so far--I haven't looked beyond interactive.rst. Thank you for moving this forward. It doesn't have to be perfect to be merged; it's a big step in the right direction.
:template: autosummary.rst | ||
:nosignatures: | ||
|
||
pyplot.show |
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.
It's a logical distinction; is it worth preceding each group with a concise statement of what makes it a family?
If you are in non-interactive mode (or created figures while in | ||
non-interactive mode) you may need to explicitly call `.pyplot.show` | ||
to bring the windows onto your screen. If you only want to run the | ||
GUI event loop for a fixed amount of time you can use `.pyplot.pause`. |
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.
-> "GUI event loop and block for a fixed amount of time..." In the typical (I suspect) use case, the key desired behavior is the blocking, not the interactivity via the GUI event loop.
doc/users/interactive.rst
Outdated
integrated with your command prompt. If you have the GUI event loop | ||
integrated with your prompt, then shown figures will be "live" while | ||
the prompt is waiting for input, if it is not integrated then your | ||
figures will only be "live" when the GUI event loop is running (via |
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.
This is confusing to me. Where does "interactive mode" fit into this second part of the paragraph? Maybe the missing point is that in "interactive mode" but without ipython magic, when working at the command line, the figure will be updated on the screen with each command, but it will not respond to mouse actions or keystrokes; for that, one needs the magic.
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.
At least PyQt and tkinter have ship with hooks that integrate with the readline implementation of the "plain" Python prompt. The IPython magic is the easiest way but not the only way.
Close Figure :rc:`keymap.quit` | ||
Constrain pan/zoom to x axis hold **x** when panning/zooming with mouse | ||
Constrain pan/zoom to y axis hold **y** when panning/zooming with mouse | ||
Preserve aspect ratio hold **CONTROL** when panning/zooming with mouse |
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.
This is needed only for zooming, I think; panning never changes the aspect ratio.
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.
right-click pan will change the view limits and respect this.
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.
I've never heard of right-click pan before, as far as I know. Maybe I've never stumbled over it because I use the Mac trackpad rather than a mouse.
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.
right-click zoom zooms out (by putting the current view limits to be where the box you drew was)
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.
A couple small typos.
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
I don't know if it's old, or too large, or what, but I had to try 3 times to merge that... |
In bb8058a via matplotlib#4779 I accidentally deleted the (illustrated) section on what the buttons on the default toolbar do. I suspect that this was a bad rebase as I do not think I would have intentionally deleted this content. This commit: - restores the content as-was: git checkout b49973a doc/users/navigation_toolbar.rst - fixes the paths to images (the files have moved around) - copy the navigation content into interactive.rst and re-remove navigation_toolbar.rst Partially addresses matplotlib#25266.
In bb8058a via matplotlib#4779 I accidentally deleted the (illustrated) section on what the buttons on the default toolbar do. I suspect that this was a bad rebase as I do not think I would have intentionally deleted this content. This commit: - restores the content as-was: git checkout b49973a doc/users/navigation_toolbar.rst - fixes the paths to images (the files have moved around) - copy the navigation content into interactive.rst and re-remove navigation_toolbar.rst Partially addresses matplotlib#25266.
This is still a work in progress (as there are still empty sections)
@mdehoon @WeatherGod Thoughts?