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

Skip to content

Commit bafcca9

Browse files
committed
add references to widget examples
plus lint snapping example
1 parent 0baa16b commit bafcca9

12 files changed

Lines changed: 151 additions & 2 deletions

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,4 +283,4 @@ per-file-ignores =
283283
examples/userdemo/connectionstyle_demo.py: E402
284284
examples/userdemo/custom_boxstyle01.py: E402
285285
examples/userdemo/pgf_preamble_sgskip.py: E402
286-
examples/widgets/textbox.py: E402
286+
examples/widgets/*.py: E402

examples/widgets/buttons.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,16 @@ def prev(self, event):
4848
bprev.on_clicked(callback.prev)
4949

5050
plt.show()
51+
52+
#############################################################################
53+
#
54+
# ------------
55+
#
56+
# References
57+
# """"""""""
58+
#
59+
# The use of the following functions, methods, classes and modules is shown
60+
# in this example:
61+
62+
import matplotlib
63+
matplotlib.widgets.Button

examples/widgets/check_buttons.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,16 @@ def func(label):
4141
check.on_clicked(func)
4242

4343
plt.show()
44+
45+
#############################################################################
46+
#
47+
# ------------
48+
#
49+
# References
50+
# """"""""""
51+
#
52+
# The use of the following functions, methods, classes and modules is shown
53+
# in this example:
54+
55+
import matplotlib
56+
matplotlib.widgets.CheckButtons

examples/widgets/cursor.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,16 @@
2424
cursor = Cursor(ax, useblit=True, color='red', linewidth=2)
2525

2626
plt.show()
27+
28+
#############################################################################
29+
#
30+
# ------------
31+
#
32+
# References
33+
# """"""""""
34+
#
35+
# The use of the following functions, methods, classes and modules is shown
36+
# in this example:
37+
38+
import matplotlib
39+
matplotlib.widgets.Cursor

examples/widgets/lasso_selector_demo_sgskip.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,17 @@ def accept(event):
9999
ax.set_title("Press enter to accept selected points.")
100100

101101
plt.show()
102+
103+
#############################################################################
104+
#
105+
# ------------
106+
#
107+
# References
108+
# """"""""""
109+
#
110+
# The use of the following functions, methods, classes and modules is shown
111+
# in this example:
112+
113+
import matplotlib
114+
matplotlib.widgets.LassoSelector
115+
matplotlib.path.Path

examples/widgets/multicursor.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,16 @@
2222

2323
multi = MultiCursor(fig.canvas, (ax1, ax2), color='r', lw=1)
2424
plt.show()
25+
26+
#############################################################################
27+
#
28+
# ------------
29+
#
30+
# References
31+
# """"""""""
32+
#
33+
# The use of the following functions, methods, classes and modules is shown
34+
# in this example:
35+
36+
import matplotlib
37+
matplotlib.widgets.MultiCursor

examples/widgets/polygon_selector_demo.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,17 @@ def disconnect(self):
9191
# After figure is closed print the coordinates of the selected points
9292
print('\nSelected points:')
9393
print(selector.xys[selector.ind])
94+
95+
#############################################################################
96+
#
97+
# ------------
98+
#
99+
# References
100+
# """"""""""
101+
#
102+
# The use of the following functions, methods, classes and modules is shown
103+
# in this example:
104+
105+
import matplotlib
106+
matplotlib.widgets.PolygonSelector
107+
matplotlib.path.Path

examples/widgets/radio_buttons.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,16 @@ def stylefunc(label):
5353
radio3.on_clicked(stylefunc)
5454

5555
plt.show()
56+
57+
#############################################################################
58+
#
59+
# ------------
60+
#
61+
# References
62+
# """"""""""
63+
#
64+
# The use of the following functions, methods, classes and modules is shown
65+
# in this example:
66+
67+
import matplotlib
68+
matplotlib.widgets.RadioButtons

examples/widgets/rectangle_selector.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,16 @@ def toggle_selector(event):
5757
interactive=True)
5858
fig.canvas.mpl_connect('key_press_event', toggle_selector)
5959
plt.show()
60+
61+
#############################################################################
62+
#
63+
# ------------
64+
#
65+
# References
66+
# """"""""""
67+
#
68+
# The use of the following functions, methods, classes and modules is shown
69+
# in this example:
70+
71+
import matplotlib
72+
matplotlib.widgets.RectangleSelector

examples/widgets/slider_demo.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,18 @@ def colorfunc(label):
6363
colorfunc(radio.value_selected)
6464

6565
plt.show()
66+
67+
#############################################################################
68+
#
69+
# ------------
70+
#
71+
# References
72+
# """"""""""
73+
#
74+
# The use of the following functions, methods, classes and modules is shown
75+
# in this example:
76+
77+
import matplotlib
78+
matplotlib.widgets.Button
79+
matplotlib.widgets.RadioButtons
80+
matplotlib.widgets.Slider

0 commit comments

Comments
 (0)