|
1 |
| -from helpers import assert_equality |
| 1 | +from .helpers import assert_equality |
2 | 2 |
|
3 | 3 |
|
4 | 4 | def plot():
|
5 | 5 | import numpy as np
|
6 |
| - from matplotlib import pyplot as pp |
| 6 | + from matplotlib import pyplot as plt |
7 | 7 |
|
8 |
| - fig = pp.figure() |
| 8 | + fig = plt.figure() |
9 | 9 |
|
10 | 10 | an = np.linspace(0, 2 * np.pi, 10)
|
11 | 11 |
|
12 |
| - pp.subplot(221) |
13 |
| - pp.plot(3 * np.cos(an), 3 * np.sin(an)) |
14 |
| - pp.title("not equal, looks like ellipse", fontsize=10) |
| 12 | + plt.subplot(221) |
| 13 | + plt.plot(3 * np.cos(an), 3 * np.sin(an)) |
| 14 | + plt.title("not equal, looks like ellipse", fontsize=10) |
15 | 15 |
|
16 |
| - pp.subplot(222) |
17 |
| - pp.plot(3 * np.cos(an), 3 * np.sin(an)) |
18 |
| - pp.axis("equal") |
19 |
| - pp.title("equal, looks like circle", fontsize=10) |
| 16 | + plt.subplot(222) |
| 17 | + plt.plot(3 * np.cos(an), 3 * np.sin(an)) |
| 18 | + plt.axis("equal") |
| 19 | + plt.title("equal, looks like circle", fontsize=10) |
20 | 20 |
|
21 |
| - pp.subplot(223) |
22 |
| - pp.plot(3 * np.cos(an), 3 * np.sin(an)) |
23 |
| - pp.axis("equal") |
24 |
| - pp.axis([-3, 3, -3, 3]) |
25 |
| - pp.title("looks like circle, even after changing limits", fontsize=10) |
| 21 | + plt.subplot(223) |
| 22 | + plt.plot(3 * np.cos(an), 3 * np.sin(an)) |
| 23 | + plt.axis("equal") |
| 24 | + plt.axis([-3, 3, -3, 3]) |
| 25 | + plt.title("looks like circle, even after changing limits", fontsize=10) |
26 | 26 |
|
27 |
| - pp.subplot(224) |
28 |
| - pp.plot(3 * np.cos(an), 3 * np.sin(an)) |
29 |
| - pp.axis("equal") |
30 |
| - pp.axis([-3, 3, -3, 3]) |
31 |
| - pp.plot([0, 4], [0, 4]) |
32 |
| - pp.title("still equal after adding line", fontsize=10) |
| 27 | + plt.subplot(224) |
| 28 | + plt.plot(3 * np.cos(an), 3 * np.sin(an)) |
| 29 | + plt.axis("equal") |
| 30 | + plt.axis([-3, 3, -3, 3]) |
| 31 | + plt.plot([0, 4], [0, 4]) |
| 32 | + plt.title("still equal after adding line", fontsize=10) |
33 | 33 |
|
34 | 34 | return fig
|
35 | 35 |
|
36 | 36 |
|
37 | 37 | def test():
|
38 | 38 | assert_equality(plot, __file__[:-3] + "_reference.tex")
|
39 |
| - return |
0 commit comments