Skip to content

Commit 69dd918

Browse files
committed
add test for legend labels
1 parent 34c456c commit 69dd918

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

test/test_legend_labels.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
import helpers
4+
5+
6+
def plot():
7+
from matplotlib import pyplot as plt
8+
import numpy as np
9+
10+
fig = plt.figure()
11+
12+
x = np.ma.arange(0, 2*np.pi, 0.02)
13+
y1 = np.sin(1*x)
14+
y2 = np.sin(2*x)
15+
y3 = np.sin(3*x)
16+
17+
plt.plot(x, y1, label='y1')
18+
plt.plot(x, y2, label=None)
19+
plt.plot(x, y3, label='y4')
20+
plt.legend()
21+
22+
return fig
23+
24+
25+
def test():
26+
phash = helpers.Phash(plot())
27+
assert phash.phash == 'fb7c5e0aaed60094', phash.get_details()
28+
return
29+
30+
31+
if __name__ == '__main__':
32+
print(helpers.Phash(plot()).phash)
33+
# helpers.compare_with_latex(plot())

0 commit comments

Comments
 (0)