Skip to content

Commit 4d2a488

Browse files
Fix legacy logplot tests
1 parent 54961b3 commit 4d2a488

File tree

1 file changed

+39
-39
lines changed

1 file changed

+39
-39
lines changed

test/test_cleanfigure.py

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -33,45 +33,6 @@ def test_plot(self):
3333
assert numLinesRaw - numLinesClean == 18
3434
plt.close("all")
3535

36-
def test_logplot(self):
37-
x = np.logspace(-3, 3, 20)
38-
y = np.logspace(-3, 3, 20)
39-
40-
with plt.rc_context(rc=RC_PARAMS):
41-
fig, ax = plt.subplots(1, 1, figsize=(5, 5))
42-
ax.plot(x, y)
43-
ax.set_xscale("log")
44-
ax.set_yscale("log")
45-
ax.set_ylim([10 ** (-2), 10 ** (2)])
46-
ax.set_xlim([10 ** (-2), 10 ** (2)])
47-
raw = get_tikz_code()
48-
49-
clean_figure(fig)
50-
clean = get_tikz_code()
51-
numLinesRaw = raw.count("\n")
52-
numLinesClean = clean.count("\n")
53-
assert numLinesRaw - numLinesClean == 11
54-
plt.close("all")
55-
56-
def test_semilogplot(self):
57-
x = np.logspace(-3, 3, 20)
58-
y = np.linspace(1, 100, 20)
59-
60-
with plt.rc_context(rc=RC_PARAMS):
61-
fig, ax = plt.subplots(1, 1, figsize=(5, 5))
62-
ax.plot(x, y)
63-
ax.set_xscale("log")
64-
ax.set_xlim([10 ** (-2), 10 ** (2)])
65-
ax.set_ylim([20, 80])
66-
raw = get_tikz_code()
67-
68-
clean_figure(fig)
69-
clean = get_tikz_code()
70-
numLinesRaw = raw.count("\n")
71-
numLinesClean = clean.count("\n")
72-
assert numLinesRaw - numLinesClean == 6
73-
plt.close("all")
74-
7536
def test_step(self):
7637
x = np.linspace(1, 100, 20)
7738
y = np.linspace(1, 100, 20)
@@ -664,6 +625,45 @@ def test_loglog_2(self):
664625
assert numLinesClean == 27
665626
plt.close("all")
666627

628+
def test_loglog_3(self):
629+
x = np.logspace(-3, 3, 20)
630+
y = np.logspace(-3, 3, 20)
631+
632+
with plt.rc_context(rc=RC_PARAMS):
633+
fig, ax = plt.subplots(1, 1, figsize=(5, 5))
634+
ax.plot(x, y)
635+
ax.set_xscale("log")
636+
ax.set_yscale("log")
637+
ax.set_ylim([10 ** (-2), 10 ** (2)])
638+
ax.set_xlim([10 ** (-2), 10 ** (2)])
639+
raw = get_tikz_code()
640+
641+
clean_figure(fig)
642+
clean = get_tikz_code()
643+
numLinesRaw = raw.count("\n")
644+
numLinesClean = clean.count("\n")
645+
assert numLinesRaw - numLinesClean == 18
646+
plt.close("all")
647+
648+
def test_xlog_3(self):
649+
x = np.logspace(-3, 3, 20)
650+
y = np.linspace(1, 100, 20)
651+
652+
with plt.rc_context(rc=RC_PARAMS):
653+
fig, ax = plt.subplots(1, 1, figsize=(5, 5))
654+
ax.plot(x, y)
655+
ax.set_xscale("log")
656+
ax.set_xlim([10 ** (-2), 10 ** (2)])
657+
ax.set_ylim([20, 80])
658+
raw = get_tikz_code()
659+
660+
clean_figure(fig)
661+
clean = get_tikz_code()
662+
numLinesRaw = raw.count("\n")
663+
numLinesClean = clean.count("\n")
664+
assert numLinesRaw - numLinesClean == 18
665+
plt.close("all")
666+
667667

668668
def test_memory():
669669
plt.plot(np.arange(100000))

0 commit comments

Comments
 (0)