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

DOC: Start to document interactive figures #4779

Merged
merged 36 commits into from May 21, 2020

Conversation

tacaswell
Copy link
Member

This is still a work in progress (as there are still empty sections)

@mdehoon @WeatherGod Thoughts?

@mdehoon
Copy link
Contributor

mdehoon commented Jul 24, 2015

Btw I think issue #4732 should be addressed first.

@tacaswell
Copy link
Member Author

#4732 in addressed by #4738

@tacaswell tacaswell added this to the next point release milestone Aug 6, 2015
@tacaswell
Copy link
Member Author

@mdehoon Have you had a chance to look at the updated text?

graphs.

This page is meant to be a rapid introduction to the relevant details of
integrating the matplotlib with a GUI event loop.
Copy link
Member

Choose a reason for hiding this comment

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

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`
Copy link
Member

Choose a reason for hiding this comment

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

(sp)

@mdboom
Copy link
Member

mdboom commented Oct 20, 2015

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.

@tacaswell tacaswell modified the milestones: next major release (2.0), next point release (1.5.0) Oct 29, 2015
@QuLogic
Copy link
Member

QuLogic commented Feb 18, 2016

I don't think this is required to be on 2.0.

@QuLogic QuLogic modified the milestones: 2.1 (next point release), 2.0 (style change major release) Feb 18, 2016
@tacaswell tacaswell mentioned this pull request Jul 1, 2016
@tacaswell tacaswell modified the milestones: 2.0.1 (next bug fix release), 2.1 (next point release) Dec 17, 2016
@NelleV NelleV changed the title DOC: Start to document interactive figures [WIP] DOC: Start to document interactive figures Dec 19, 2016
@QuLogic QuLogic modified the milestones: 2.0.1 (next bug fix release), 2.0.2 (next bug fix release) May 3, 2017
Copy link
Member

@QuLogic QuLogic left a 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?

doc/users/interactive.rst Outdated Show resolved Hide resolved
doc/users/interactive.rst Outdated Show resolved Hide resolved
doc/users/interactive.rst Outdated Show resolved Hide resolved
doc/users/interactive.rst Outdated Show resolved Hide resolved
doc/users/interactive.rst Outdated Show resolved Hide resolved
doc/users/interactive.rst Outdated Show resolved Hide resolved
@tacaswell tacaswell changed the title [WIP] DOC: Start to document interactive figures DOC: Start to document interactive figures May 7, 2020
@tacaswell
Copy link
Member Author

In principle this is good to go, but I am not a great writer...

tacaswell and others added 5 commits May 7, 2020 18:08
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
doc/api/blocking_input_api.rst Outdated Show resolved Hide resolved
doc/users/interactive.rst Outdated Show resolved Hide resolved
doc/users/interactive.rst Show resolved Hide resolved
doc/users/interactive.rst Outdated Show resolved Hide resolved
:template: autosummary.rst
:nosignatures:

pyplot.show
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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?

doc/users/interactive_guide.rst Outdated Show resolved Hide resolved
doc/users/interactive_guide.rst Outdated Show resolved Hide resolved
lib/matplotlib/pyplot.py Outdated Show resolved Hide resolved
lib/matplotlib/pyplot.py Outdated Show resolved Hide resolved
lib/matplotlib/pyplot.py Outdated Show resolved Hide resolved
tacaswell and others added 3 commits May 8, 2020 20:09
Copy link
Member

@QuLogic QuLogic left a 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.

lib/matplotlib/pyplot.py Outdated Show resolved Hide resolved
lib/matplotlib/pyplot.py Outdated Show resolved Hide resolved
lib/matplotlib/pyplot.py Outdated Show resolved Hide resolved
tacaswell and others added 2 commits May 9, 2020 18:18
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Copy link
Member

@efiring efiring left a 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
Copy link
Member

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?

doc/users/interactive.rst Outdated Show resolved Hide resolved
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`.
Copy link
Member

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 Show resolved Hide resolved
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
Copy link
Member

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.

Copy link
Member Author

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
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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)

doc/users/interactive.rst Outdated Show resolved Hide resolved
doc/users/interactive.rst Outdated Show resolved Hide resolved
Copy link
Member

@QuLogic QuLogic left a 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.

doc/users/interactive.rst Outdated Show resolved Hide resolved
doc/users/interactive.rst Outdated Show resolved Hide resolved
doc/users/interactive.rst Outdated Show resolved Hide resolved
doc/users/interactive.rst Outdated Show resolved Hide resolved
doc/users/interactive.rst Outdated Show resolved Hide resolved
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
@QuLogic QuLogic merged commit 46936d7 into matplotlib:master May 21, 2020
@QuLogic
Copy link
Member

QuLogic commented May 21, 2020

I don't know if it's old, or too large, or what, but I had to try 3 times to merge that...

@QuLogic QuLogic moved this from Work in Progress to Done in Reviewing pull requests. May 21, 2020
@tacaswell tacaswell deleted the doc_interactive_doc branch May 21, 2020 14:07
@timhoffm timhoffm mentioned this pull request Jul 14, 2020
6 tasks
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request May 19, 2023
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.
melissawm pushed a commit to melissawm/matplotlib that referenced this pull request Jun 15, 2023
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet