Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 757e040

Browse files
tacaswellQuLogic
andauthored
DOC: correct many spelling / grammer / clarity issues
Co-authored-by: Elliott Sales de Andrade <[email protected]>
1 parent d70d5ad commit 757e040

File tree

4 files changed

+39
-40
lines changed

4 files changed

+39
-40
lines changed

doc/devel/documenting_mpl.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ Image files can directly included in pages with the ``image::`` directive.
307307
e.g., :file:`thirdpartypackages/index.rst` displays the images for the third-party
308308
packages as static images::
309309

310-
.. image:: ../_static/toolbar.png
310+
.. image:: /_static/toolbar.png
311311

312312
as rendered on the page: :ref:`thirdparty-index`.
313313

doc/users/interactive.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010

1111

1212
When working with data it is often invaluable to be able to interact
13-
with your plots In many cases the built in pan/zoom and mouse-location
13+
with your plots. In many cases the built in pan/zoom and mouse-location
1414
tools are sufficient, but you can also use the Matplotlib event system
15-
to build a customized data exploration tools.
15+
to build customized data exploration tools.
1616

1717
Matplotlib ships with :ref:`backends <what-is-a-backend>` binding to
1818
several GUI toolkits (Qt, Tk, Wx, Gtk, OSX, js) and third party
1919
packages provide bindings to `kivy
2020
<https://github.com/kivy-garden/garden.matplotlib>`__ and `Jupyter Lab
2121
<https://github.com/matplotlib/ipympl>`__. For the figures to be
22-
"live" the GUI event loop will need to be integrated with your prompt, the
22+
"live" the GUI event loop will need to be integrated with your prompt. The
2323
simplest way is to use IPython (see :ref:`below <ipython-pylab>`).
2424

2525
The `.pyplot` module provides two functions for creating Figures that,
@@ -33,7 +33,7 @@ embedded in GUI windows, and ready for interactive use out of the box
3333
Creates a new `.figure.Figure` and fills it with a grid of `.axes.Axes`
3434

3535
Matplotlib keeps a reference to all of the open figures created this
36-
way so they will not be garbage collected. You can close all off your
36+
way so they will not be garbage collected. You can close all of your
3737
open figures via ``plt.close('all')``.
3838

3939
For discussion of how this works under the hood see:
@@ -52,7 +52,7 @@ IPython integration
5252

5353
We recommend using IPython for an interactive shell. In addition to
5454
all of its features (improved tab-completion, magics,
55-
multiline-editing, etc), it also ensures that the GUI toolkit event
55+
multiline editing, etc), it also ensures that the GUI toolkit event
5656
loop is properly integrated with the command line (see
5757
:ref:`cp_integration`). To configure the integration and enable
5858
:ref:`interactive mode <controlling-interactive>` use the
@@ -140,12 +140,12 @@ Interactive mode
140140

141141
Interactive mode controls:
142142

143-
- if created figures are automatically shown
144-
- if changes to artists automatically trigger re-drawing existing figures
145-
- if `.pyplot.show` blocks or not
143+
- whether created figures are automatically shown
144+
- whether changes to artists automatically trigger re-drawing existing figures
145+
- whether `.pyplot.show` blocks or not
146146

147147

148-
if in interactive mode then:
148+
If in interactive mode, then:
149149

150150
- newly created figures will be shown immediately
151151
- figures will automatically redraw on change
@@ -166,7 +166,7 @@ GUI event loop for a fixed amount of time you can use `.pyplot.pause`.
166166
Being in interactive mode is orthogonal to the GUI event loop being
167167
integrated with your command prompt. If you have the GUI event loop
168168
integrated with your prompt, then shown figures will be "live" while
169-
the prompt is waiting for input, if it is not integrated than your
169+
the prompt is waiting for input, if it is not integrated then your
170170
figures will only be "live" when the GUI event loop is running (via
171171
`.pyplot.show`, `.pyplot.pause`, or explicitly starting the GUI main
172172
loop).

doc/users/interactive_guide.rst

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Axes to inspect your data is 'baked in' to Matplotlib. This is
1313
supported by a full mouse and keyboard event handling system that
1414
you can use to build sophisticated interactive graphs.
1515

16-
This is meant to be an introduction to the low-level details of how
17-
integrating the Matplotlib with a GUI event loop works. For a more
18-
practical introduction the Matplotlib event API see :ref:`event
16+
This guide is meant to be an introduction to the low-level details of
17+
how Matplotlib integration with a GUI event loop works. For a more
18+
practical introduction to the Matplotlib event API see :ref:`event
1919
handling system <event-handling-tutorial>`, `Interactive Tutorial
2020
<https://github.com/matplotlib/interactive_tutorial>`__, and
2121
`Interactive Applications using Matplotlib
@@ -45,7 +45,7 @@ while the *Evaluate* and *Print* are responsible for interpreting the
4545
input and then **doing** something about it.
4646

4747
In practice we interact with a framework that provides a mechanism to
48-
register callbacks to be called in response to specific event rather
48+
register callbacks to be run in response to specific events rather
4949
than directly implement the I/O loop [#f2]_. For example "when the
5050
user clicks on this button, please run this function" or "when the
5151
user hits the 'z' key, please run this other function". This allows
@@ -60,10 +60,9 @@ All GUI frameworks (Qt, Wx, Gtk, tk, OSX, or web) have some method of
6060
capturing user interactions and passing them back to the application
6161
(for example ``Signal`` / ``Slot`` framework in Qt) but the exact
6262
details depend on the toolkit. Matplotlib has a :ref:`backend
63-
<what-is-a-backend>` for each GUI toolkit we support which use the
64-
toolkit API to bridge the toolkit UI events into Matplotlib events
65-
into Matplotlib's :ref:`event handling system
66-
<event-handling-tutorial>`. You can then use
63+
<what-is-a-backend>` for each GUI toolkit we support which uses the
64+
toolkit API to bridge the toolkit UI events into Matplotlib's :ref:`event
65+
handling system <event-handling-tutorial>`. You can then use
6766
`.FigureCanvasBase.mpl_connect` to connect your function to
6867
Matplotlib's event handling system. This allows you to directly
6968
interact with your data and write GUI toolkit agnostic user
@@ -77,8 +76,8 @@ Command Prompt Integration
7776

7877
So far, so good. We have the REPL (like the IPython terminal) that
7978
lets us interactively send things code to the interpreter and get
80-
results back. We also have the GUI toolkit that run an event loop
81-
waiting for user input and let up register functions to be run when
79+
results back. We also have the GUI toolkit that runs an event loop
80+
waiting for user input and lets us register functions to be run when
8281
that happens. However, if we want to do both we have a problem: the
8382
prompt and the GUI event loop are both infinite loops that each think
8483
*they* are in charge! In order for both the prompt and the GUI windows
@@ -148,7 +147,7 @@ able to have a usable prompt **and** interactive figure windows.
148147

149148
We can do this using the 'input hook' feature of the interactive
150149
prompt. This hook is called by the prompt as it waits for the user
151-
type (even for a fast typist the prompt is mostly waiting for the
150+
to type (even for a fast typist the prompt is mostly waiting for the
152151
human to think and move their fingers). Although the details vary
153152
between prompts the logic is roughly
154153

@@ -157,7 +156,7 @@ between prompts the logic is roughly
157156
3. as soon as the user hits a key, exit the GUI event loop and handle the key
158157
4. repeat
159158

160-
This gives us the illusion of simultaneously having an interactive GUI
159+
This gives us the illusion of simultaneously having interactive GUI
161160
windows and an interactive prompt. Most of the time the GUI event
162161
loop is running, but as soon as the user starts typing the prompt
163162
takes over again.
@@ -167,7 +166,7 @@ python is otherwise idle and waiting for user input. If you want the
167166
GUI to be responsive during long running code it is necessary to
168167
periodically flush the GUI event queue as described :ref:`above
169168
<spin_event_loop>`. In this case it is your code, not the REPL, which
170-
is blocking process so you need to handle the "time-share" manually.
169+
is blocking the process so you need to handle the "time-share" manually.
171170
Conversely, a very slow figure draw will block the prompt until it
172171
finishes drawing.
173172

@@ -220,7 +219,7 @@ event loop using the methods described :ref:`above <cp_block_the_prompt>`.
220219

221220
You can also use the methods described in :ref:`cp_block_the_prompt`
222221
to suspend run the GUI event loop. Once the loop exits your code will
223-
resume. In general, anyplace you would use `time.sleep` you can use
222+
resume. In general, any place you would use `time.sleep` you can use
224223
`.pyplot.pause` instead with the added benefit of interactive figures.
225224

226225
For example, if you want to poll for data you could use something like ::
@@ -280,7 +279,7 @@ For example ::
280279
slow_loop(100, ln)
281280

282281
While this will feel a bit laggy (as we are only processing user input
283-
every 100ms where as 20-30ms is what feels "responsive") it will
282+
every 100ms whereas 20-30ms is what feels "responsive") it will
284283
respond.
285284

286285
If you make changes to the plot and want it re-rendered you will need
@@ -304,7 +303,7 @@ We can add this our example above as ::
304303

305304
The more frequently you call `.FigureCanvasBase.flush_events` the more
306305
responsive your figure will feel but at the cost of spending more
307-
resource on the visualization and less on your computation.
306+
resources on the visualization and less on your computation.
308307

309308

310309
.. _stale_artists:
@@ -315,10 +314,10 @@ Stale Artists
315314
Artists (as of Matplotlib 1.5) have a **stale** attribute which is
316315
`True` if the internal state of the artist has changed since the last
317316
time it was rendered. By default the stale state is propagated up to
318-
the Artists parents in the draw tree, thus if the color of a `.Line2D`
319-
instance is changed, the `.axes.Axes` and `.figure.Figure` it is
320-
contained in will also be marked as "stale". Thus, ``fig.stale`` will
321-
report of any artist in the figure has been modified and out of sync
317+
the Artists parents in the draw tree, e.g., if the color of a `.Line2D`
318+
instance is changed, the `.axes.Axes` and `.figure.Figure` that
319+
contain it will also be marked as "stale". Thus, ``fig.stale`` will
320+
report if any artist in the figure has been modified and is out of sync
322321
with what is displayed on the screen. This is intended to be used to
323322
determine if ``draw_idle`` should be called to schedule a re-rendering
324323
of the figure.
@@ -330,17 +329,17 @@ with the signature ::
330329
...
331330

332331
which by default is set to a function that forwards the stale state to
333-
the artists parent. If you wish to suppress a given artist from propagating
332+
the artist's parent. If you wish to suppress a given artist from propagating
334333
set this attribute to None.
335334

336335
`.figure.Figure` instances do not have a containing artist and their
337336
default callback is `None`. If you call `.pyplot.ion` and are not in
338-
``IPython`` we will install callback to invoke
339-
`~.backend_bases.FigureCanvasBase.draw_idle` when ever the
337+
``IPython`` we will install a callback to invoke
338+
`~.backend_bases.FigureCanvasBase.draw_idle` whenever the
340339
`.figure.Figure` becomes stale. In ``IPython`` we use the
341340
``'post_execute'`` hook to invoke
342341
`~.backend_bases.FigureCanvasBase.draw_idle` on any stale figures
343-
after having executed the users input, but before returning the prompt
342+
after having executed the user's input, but before returning the prompt
344343
to the user. If you are not using `.pyplot` you can use the callback
345344
`Figure.stale_callback` attribute to be notified when a figure has
346345
become stale.
@@ -363,7 +362,7 @@ Draw Idle
363362
In almost all cases, we recommend using
364363
`backend_bases.FigureCanvasBase.draw_idle` over
365364
`backend_bases.FigureCanvasBase.draw`. ``draw`` forces a rendering of
366-
the figure where as ``draw_idle`` schedules a rendering the next time
365+
the figure whereas ``draw_idle`` schedules a rendering the next time
367366
the GUI window is going to re-paint the screen. This improves
368367
performance by only rendering pixels that will be shown on the screen. If
369368
you want to be sure that the screen is updated as soon as possible do ::
@@ -448,7 +447,7 @@ method. The source for the prompt_toolkit input hooks lives at
448447
.. [#f2] Or you can `write your own
449448
<https://www.youtube.com/watch?v=ZzfHjytDceU>`__ if you must.
450449
451-
.. [#f3] These examples are agressively dropping many of the
450+
.. [#f3] These examples are aggressively dropping many of the
452451
complexities that must be dealt with in the real world such as
453-
keyboard interupts, timeouts, bad input, resource
452+
keyboard interrupts, timeouts, bad input, resource
454453
allocation and cleanup, etc.

lib/matplotlib/pyplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,11 @@ def show(*args, **kwargs):
310310
Display all open figures.
311311
312312
In non-interactive mode, **block** defaults to True. All figures
313-
will display and show will not return until all widows are closed.
313+
will display and show will not return until all windows are closed.
314314
If there are no figures, return immediately.
315315
316316
In interactive mode **block** defaults to False. This will ensure
317-
that all of the figures are shown and immediately return.
317+
that all of the figures are shown and this function immediately returns.
318318
319319
Parameters
320320
----------

0 commit comments

Comments
 (0)