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 a967158

Browse filesBrowse files
committed
Merge pull request #4654 from domspad/MEP12-on-annotation-demo2.py
MEP12 on annotation_demo.py
2 parents 0a7af4e + 38215ef commit a967158
Copy full SHA for a967158

File tree

Expand file treeCollapse file tree

2 files changed

+12
-12
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+12
-12
lines changed

‎examples/pylab_examples/annotation_demo.py

Copy file name to clipboardExpand all lines: examples/pylab_examples/annotation_demo.py
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@
3535
"""
3636

3737

38-
from matplotlib.pyplot import figure, show
38+
import matplotlib.pyplot as plt
3939
from matplotlib.patches import Ellipse
4040
import numpy as np
4141

4242

4343
if 1:
4444
# if only one location is given, the text and xypoint being
4545
# annotated are assumed to be the same
46-
fig = figure()
46+
fig = plt.figure()
4747
ax = fig.add_subplot(111, autoscale_on=False, xlim=(-1, 5), ylim=(-3, 5))
4848

4949
t = np.arange(0.0, 5.0, 0.01)
@@ -93,7 +93,7 @@
9393
# example is placed in the fractional figure coordinate system.
9494
# Text keyword args like horizontal and vertical alignment are
9595
# respected
96-
fig = figure()
96+
fig = plt.figure()
9797
ax = fig.add_subplot(111, polar=True)
9898
r = np.arange(0, 1, 0.001)
9999
theta = 2*2*np.pi*r
@@ -120,7 +120,7 @@
120120

121121
el = Ellipse((0, 0), 10, 20, facecolor='r', alpha=0.5)
122122

123-
fig = figure()
123+
fig = plt.figure()
124124
ax = fig.add_subplot(111, aspect='equal')
125125
ax.add_artist(el)
126126
el.set_clip_box(ax.bbox)
@@ -138,4 +138,4 @@
138138
ax.set_xlim(-20, 20)
139139
ax.set_ylim(-20, 20)
140140

141-
show()
141+
plt.show()

‎examples/pylab_examples/annotation_demo2.py

Copy file name to clipboardExpand all lines: examples/pylab_examples/annotation_demo2.py
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

2-
from matplotlib.pyplot import figure, show
2+
import matplotlib.pyplot as plt
33
from matplotlib.patches import Ellipse
44
import numpy as np
55

66
if 1:
7-
fig = figure(1, figsize=(8, 5))
7+
fig = plt.figure(1, figsize=(8, 5))
88
ax = fig.add_subplot(111, autoscale_on=False, xlim=(-1, 5), ylim=(-4, 3))
99

1010
t = np.arange(0.0, 5.0, 0.01)
@@ -80,7 +80,7 @@
8080

8181

8282
if 1:
83-
fig = figure(2)
83+
fig = plt.figure(2)
8484
fig.clf()
8585
ax = fig.add_subplot(111, autoscale_on=False, xlim=(-1, 5), ylim=(-5, 3))
8686

@@ -98,7 +98,7 @@
9898
ax.annotate('fancy', xy=(2., -1), xycoords='data',
9999
xytext=(-100, 60), textcoords='offset points',
100100
size=20,
101-
#bbox=dict(boxstyle="round", fc="0.8"),
101+
# bbox=dict(boxstyle="round", fc="0.8"),
102102
arrowprops=dict(arrowstyle="fancy",
103103
fc="0.6", ec="none",
104104
patchB=el,
@@ -108,7 +108,7 @@
108108
ax.annotate('simple', xy=(2., -1), xycoords='data',
109109
xytext=(100, 60), textcoords='offset points',
110110
size=20,
111-
#bbox=dict(boxstyle="round", fc="0.8"),
111+
# bbox=dict(boxstyle="round", fc="0.8"),
112112
arrowprops=dict(arrowstyle="simple",
113113
fc="0.6", ec="none",
114114
patchB=el,
@@ -118,7 +118,7 @@
118118
ax.annotate('wedge', xy=(2., -1), xycoords='data',
119119
xytext=(-100, -100), textcoords='offset points',
120120
size=20,
121-
#bbox=dict(boxstyle="round", fc="0.8"),
121+
# bbox=dict(boxstyle="round", fc="0.8"),
122122
arrowprops=dict(arrowstyle="wedge,tail_width=0.7",
123123
fc="0.6", ec="none",
124124
patchB=el,
@@ -150,4 +150,4 @@
150150
)
151151

152152

153-
show()
153+
plt.show()

0 commit comments

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