|
32 | 32 | """ |
33 | 33 |
|
34 | 34 |
|
35 | | -from pylab import figure, show, nx |
| 35 | +from matplotlib.pyplot import figure, show |
36 | 36 | from matplotlib.patches import Ellipse |
| 37 | +import numpy as npy |
| 38 | + |
37 | 39 |
|
38 | 40 | if 1: |
39 | 41 | # if only one location is given, the text and xypoint being |
40 | 42 | # annotated are assumed to be the same |
41 | 43 | fig = figure() |
42 | 44 | ax = fig.add_subplot(111, autoscale_on=False, xlim=(-1,5), ylim=(-3,5)) |
43 | 45 |
|
44 | | - t = nx.arange(0.0, 5.0, 0.01) |
45 | | - s = nx.cos(2*nx.pi*t) |
| 46 | + t = npy.arange(0.0, 5.0, 0.01) |
| 47 | + s = npy.cos(2*npy.pi*t) |
46 | 48 | line, = ax.plot(t, s, lw=3, color='purple') |
47 | 49 |
|
48 | 50 | ax.annotate('axes center', xy=(.5, .5), xycoords='axes fraction', |
|
85 | 87 | # respected |
86 | 88 | fig = figure() |
87 | 89 | ax = fig.add_subplot(111, polar=True) |
88 | | - r = nx.arange(0,1,0.001) |
89 | | - theta = 2*2*nx.pi*r |
| 90 | + r = npy.arange(0,1,0.001) |
| 91 | + theta = 2*2*npy.pi*r |
90 | 92 | line, = ax.plot(theta, r, color='#ee8d18', lw=3) |
91 | 93 |
|
92 | 94 | ind = 800 |
|
115 | 117 | ax.add_artist(el) |
116 | 118 | el.set_clip_box(ax.bbox) |
117 | 119 | ax.annotate('the top', |
118 | | - xy=(nx.pi/2., 10.), # theta, radius |
119 | | - xytext=(nx.pi/3, 20.), # theta, radius |
| 120 | + xy=(npy.pi/2., 10.), # theta, radius |
| 121 | + xytext=(npy.pi/3, 20.), # theta, radius |
120 | 122 | xycoords='polar', |
121 | 123 | textcoords='polar', |
122 | 124 | arrowprops=dict(facecolor='black', shrink=0.05), |
|
0 commit comments