8000 Doc yinleon rebase by tacaswell · Pull Request #8860 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Doc yinleon rebase #8860

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

Merged
merged 7 commits into from
Jul 15, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
DOC: Minor typos, https, and pep8
  • Loading branch information
tacaswell committed Jul 11, 2017
commit 20b6309846363f44c60dda06d306075f3b1dc493
17 changes: 10 additions & 7 deletions examples/event_handling/poly_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
===========

This is an example to show how to build cross-GUI applications using
matplotlib event handling to interact with objects on the canvas.
Matplotlib event handling to interact with objects on the canvas.
"""
import numpy as np
from matplotlib.lines import Line2D
Expand Down Expand Up @@ -33,17 +33,19 @@ class PolygonInteractor(object):

def __init__(self, ax, poly):
if poly.figure is None:
raise RuntimeError('You must first add the polygon to a figure or canvas before defining the interactor')
raise RuntimeError('You must first add the polygon to a figure '
'or canvas before defining the interactor')
self.ax = ax
canvas = poly.figure.canvas
self.poly = poly

x, y = zip(*self.poly.xy)
self.line = Line2D(x, y, marker='o', markerfacecolor='r', animated=True)
self.line = Line2D(x, y,
marker='o', markerfacecolor='r',
animated=True)
self.ax.add_line(self.line)
#self._update_line(poly)

cid = self.poly.add_callback(self.poly_changed)
self.cid = self.poly.add_callback(self.poly_changed)
self._ind = None # the active vert

canvas.mpl_connect('draw_event', self.draw_callback)
Expand Down Expand Up @@ -112,7 +114,9 @@ def key_press_callback(self, event):
elif event.key == 'd':
ind = self.get_ind_under_point(event)
if ind is not None:
self.poly.xy = [tup for i, tup in enumerate(self.poly.xy) if i != ind]
self.poly.xy = [tup
for i, tup in enumerate(self.poly.xy)
if i != ind]
self.line.set_data(zip(*self.poly.xy))
elif event.key == 'i':
xys = self.poly.get_transform().transform(self.poly.xy)
Expand Down Expand Up @@ -172,7 +176,6 @@ def motion_notify_callback(self, event):
ax.add_patch(poly)
p = PolygonInteractor(ax, poly)

#ax.add_line(p.line)
ax.set_title('Click and drag a point to move it')
ax.set_xlim((-2, 2))
ax.set_ylim((-2, 2))
Expand Down
6 changes: 3 additions & 3 deletions examples/mplot3d/mixed_subplots.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
============================================
Demonstrate the mixing of 2D and 3D subplots
============================================
=================================
2D and 3D *Axes* in same *Figure*
=================================

This example shows a how to plot a 2D and 3D plot on the same figure.
"""
Expand Down
1 change: 0 additions & 1 deletion examples/pylab_examples/bar_stacked.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

"""

# a stacked bar plot with errorbars
import numpy as np
import matplotlib.pyplot as plt

Expand Down
2 changes: 1 addition & 1 deletion examples/pylab_examples/geo_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
======================

This shows 4 possible projections using subplot. Matplotlib also
supports `Basemaps Toolkit <http://matplotlib.org/basemap>`_ and
supports `Basemaps Toolkit <https://matplotlib.org/basemap>`_ and
`Cartopy <http://scitools.org.uk/cartopy>`_ for geographic projections.

"""
Expand Down
0