Skip to content

Commit 52b7bd9

Browse files
committed
update some tests
1 parent 42428aa commit 52b7bd9

File tree

2 files changed

+24
-25
lines changed

2 files changed

+24
-25
lines changed

tests/test_custom_collection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
import matplotlib
77
import matplotlib.pyplot as plt
88
import numpy as np
9-
from helpers import assert_equality
9+
10+
from .helpers import assert_equality
1011

1112

1213
class TransformedEllipseCollection(matplotlib.collections.Collection):
@@ -53,7 +54,7 @@ def plot():
5354
fig = plt.figure()
5455
ax = fig.add_subplot(111)
5556

56-
theta = np.linspace(0, 2 * np.pi, 12, endpoint=False)
57+
theta = np.linspace(0, 2 * np.pi, 6, endpoint=False)
5758
mats = rot(theta) @ np.diag([0.1, 0.2])
5859
x = np.cos(theta)
5960
y = np.sin(theta)
@@ -74,4 +75,3 @@ def plot():
7475

7576
def test():
7677
assert_equality(plot, "test_custom_collection_reference.tex")
77-
return

tests/test_subplot4x4.py

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,38 @@
1-
from helpers import assert_equality
1+
from .helpers import assert_equality
22

33

44
def plot():
55
import numpy as np
6-
from matplotlib import pyplot as pp
6+
from matplotlib import pyplot as plt
77

8-
fig = pp.figure()
8+
fig = plt.figure()
99

1010
an = np.linspace(0, 2 * np.pi, 10)
1111

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)
1515

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)
2020

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)
2626

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)
3333

3434
return fig
3535

3636

3737
def test():
3838
assert_equality(plot, __file__[:-3] + "_reference.tex")
39-
return

0 commit comments

Comments
 (0)