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

Skip to content

Commit e4cf4e4

Browse files
committed
pep8 fixes to transoffset.py
1 parent d9001f8 commit e4cf4e4

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

examples/pylab_examples/transoffset.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
'''
1919

2020
import matplotlib.pyplot as plt
21+
import matplotlib.transforms as mtrans
22+
import numpy as np
23+
2124
from matplotlib.transforms import offset_copy
22-
import matplotlib.transforms as tns
2325

2426
xs = np.arange(7)
2527
ys = xs**2
@@ -31,8 +33,8 @@
3133
# we only need to make one transform. To get the
3234
# transform argument to offset_copy, we need to make the axes
3335
# first; the subplot command above is one way to do this.
34-
trans_offset = tns.offset_copy(ax.transData, fig=fig,
35-
x=0.05, y=0.10, units='inches')
36+
trans_offset = mtrans.offset_copy(ax.transData, fig=fig,
37+
x=0.05, y=0.10, units='inches')
3638

3739
for x, y in zip(xs, ys):
3840
plt.plot((x,), (y,), 'ro')
@@ -42,13 +44,13 @@
4244
# offset_copy works for polar plots also.
4345
ax = plt.subplot(2, 1, 2, polar=True)
4446

45-
trans_offset = tns.offset_copy(ax.transData, fig=fig, y=6, units='dots')
47+
trans_offset = mtrans.offset_copy(ax.transData, fig=fig, y=6, units='dots')
4648

4749
for x, y in zip(xs, ys):
4850
plt.polar((x,), (y,), 'ro')
4951
plt.text(x, y, '%d, %d' % (int(x), int(y)),
50-
transform=trans_offset,
51-
horizontalalignment='center',
52-
verticalalignment='bottom')
52+
transform=trans_offset,
53+
horizontalalignment='center',
54+
verticalalignment='bottom')
5355

5456
plt.show()

0 commit comments

Comments
 (0)