Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3891c15

Browse filesBrowse files
authored
Merge pull request #28739 from anntzer/id
Tweak interactivity docs wording (and fix capitalization).
2 parents 5a9182d + ce1af79 commit 3891c15
Copy full SHA for 3891c15

File tree

3 files changed

+11
-8
lines changed
Filter options

3 files changed

+11
-8
lines changed

‎galleries/users_explain/figure/event_handling.rst

Copy file name to clipboardExpand all lines: galleries/users_explain/figure/event_handling.rst
+9-6Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ is created every time a mouse is pressed::
251251

252252
def __call__(self, event):
253253
print('click', event)
254-
if event.inaxes!=self.line.axes: return
254+
if event.inaxes != self.line.axes:
255+
return
255256
self.xs.append(event.xdata)
256257
self.ys.append(event.ydata)
257258
self.line.set_data(self.xs, self.ys)
@@ -277,17 +278,19 @@ event.ydata)``. In addition to the ``LocationEvent`` attributes, it also has:
277278
Draggable rectangle exercise
278279
----------------------------
279280

280-
Write draggable rectangle class that is initialized with a
281+
Write a draggable rectangle class that is initialized with a
281282
`.Rectangle` instance but will move its ``xy``
282-
location when dragged. Hint: you will need to store the original
283-
``xy`` location of the rectangle which is stored as rect.xy and
283+
location when dragged.
284+
285+
Hint: You will need to store the original
286+
``xy`` location of the rectangle which is stored as ``rect.xy`` and
284287
connect to the press, motion and release mouse events. When the mouse
285288
is pressed, check to see if the click occurs over your rectangle (see
286289
`.Rectangle.contains`) and if it does, store
287-
the rectangle xy and the location of the mouse click in data coords.
290+
the rectangle xy and the location of the mouse click in data coordinates.
288291
In the motion event callback, compute the deltax and deltay of the
289292
mouse movement, and add those deltas to the origin of the rectangle
290-
you stored. The redraw the figure. On the button release event, just
293+
you stored, then redraw the figure. On the button release event, just
291294
reset all the button press data you stored as None.
292295

293296
Here is the solution::

‎galleries/users_explain/figure/interactive.rst

Copy file name to clipboardExpand all lines: galleries/users_explain/figure/interactive.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Interactive figures
1111
===================
1212

13-
When working with data, interactivity can be invaluable. The pan/zoom and
13+
Interactivity can be invaluable when exploring plots. The pan/zoom and
1414
mouse-location tools built into the Matplotlib GUI windows are often sufficient, but
1515
you can also use the event system to build customized data exploration tools.
1616

‎galleries/users_explain/figure/interactive_guide.rst

Copy file name to clipboardExpand all lines: galleries/users_explain/figure/interactive_guide.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ which would poll for new data and update the figure at 1Hz.
236236

237237
.. _spin_event_loop:
238238

239-
Explicitly spinning the event Loop
239+
Explicitly spinning the event loop
240240
----------------------------------
241241

242242
.. autosummary::

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.