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

Skip to content

MEP12 on annotation_demo.py #4654

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 4 commits into from
Jul 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 5 additions & 5 deletions examples/pylab_examples/annotation_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
"""


from matplotlib.pyplot import figure, show
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
import numpy as np


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

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

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

fig = figure()
fig = plt.figure()
ax = fig.add_subplot(111, aspect='equal')
ax.add_artist(el)
el.set_clip_box(ax.bbox)
Expand All @@ -138,4 +138,4 @@
ax.set_xlim(-20, 20)
ax.set_ylim(-20, 20)

show()
plt.show()
14 changes: 7 additions & 7 deletions examples/pylab_examples/annotation_demo2.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

from matplotlib.pyplot import figure, show
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
import numpy as np

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

t = np.arange(0.0, 5.0, 0.01)
Expand Down Expand Up @@ -80,7 +80,7 @@


if 1:
fig = figure(2)
fig = plt.figure(2)
fig.clf()
ax = fig.add_subplot(111, autoscale_on=False, xlim=(-1, 5), ylim=(-5, 3))

Expand All @@ -98,7 +98,7 @@
ax.annotate('fancy', xy=(2., -1), xycoords='data',
xytext=(-100, 60), textcoords='offset points',
size=20,
#bbox=dict(boxstyle="round", fc="0.8"),
# bbox=dict(boxstyle="round", fc="0.8"),
arrowprops=dict(arrowstyle="fancy",
fc="0.6", ec="none",
patchB=el,
Expand All @@ -108,7 +108,7 @@
ax.annotate('simple', xy=(2., -1), xycoords='data',
xytext=(100, 60), textcoords='offset points',
size=20,
#bbox=dict(boxstyle="round", fc="0.8"),
# bbox=dict(boxstyle="round", fc="0.8"),
arrowprops=dict(arrowstyle="simple",
fc="0.6", ec="none",
patchB=el,
Expand All @@ -118,7 +118,7 @@
ax.annotate('wedge', xy=(2., -1), xycoords='data',
xytext=(-100, -100), textcoords='offset points',
size=20,
#bbox=dict(boxstyle="round", fc="0.8"),
# bbox=dict(boxstyle="round", fc="0.8"),
arrowprops=dict(arrowstyle="wedge,tail_width=0.7",
fc="0.6", ec="none",
patchB=el,
Expand Down Expand Up @@ -150,4 +150,4 @@
)


show()
plt.show()