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

Skip to content

Commit 51eb482

Browse files
committed
Make LineBuilder example more complete as a stand-alone script (suggested by David Arnold)
svn path=/trunk/matplotlib/; revision=8187
1 parent 7eebaf8 commit 51eb482

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

doc/users/event_handling.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ following attributes
111111
Let's look a simple example of a canvas, where a simple line segment
112112
is created every time a mouse is pressed::
113113

114+
from matplotlib import pyplot as plt
115+
114116
class LineBuilder:
115117
def __init__(self, line):
116118
self.line = line
@@ -132,6 +134,7 @@ is created every time a mouse is pressed::
132134
line, = ax.plot([0], [0]) # empty line
133135
linebuilder = LineBuilder(line)
134136

137+
plt.show()
135138

136139

137140
The :class:`~matplotlib.backend_bases.MouseEvent` that we just used is a

0 commit comments

Comments
 (0)