Skip to content

Commit fe6bbe9

Browse files
author
Lukas Maxeiner
committed
extended test to cover base case
1 parent 3966a46 commit fe6bbe9

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

test/test_steps.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ def plot():
99
y2 = np.array([1, 2, 1, 4, 2])
1010
y3 = np.array([1, 2, 1, 4, 2])
1111
y4 = np.array([1, 2, 1, 4, 2])
12+
y5 = np.array([2, 3, 2, 5, 3])
1213

1314
plt.step(x, y1, "r-")
1415
plt.step(x, y2, "b--", where="pre")
1516
plt.step(x, y3, "g-.", where="post")
1617
plt.step(x, y4, "y:", where="mid")
17-
plt.legend(["default", "pre", "post", "mid"])
18+
plt.plot(x, y5, "c.",)
19+
plt.legend(["default", "pre", "post", "mid", "default"])
1820

19-
return plt.gcf()
21+
return plt.gcf()
2022

2123

2224
if __name__ == "__main__":

test/test_steps_reference.tex

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
1-
% This file was created by tikzplotlib v0.8.0.
1+
% This file was created by tikzplotlib v0.8.1.
22
\begin{tikzpicture}
33

44
\definecolor{color0}{rgb}{0.75,0.75,0}
5+
\definecolor{color1}{rgb}{0,0.75,0.75}
56

67
\begin{axis}[
7-
axis background/.style={fill=white!89.80392156862746!black},
8-
axis line style={white},
98
legend cell align={left},
10-
legend style={at={(0.03,0.97)}, anchor=north west, draw=white!80.0!black, fill=white!89.80392156862746!black},
9+
legend style={at={(0.03,0.97)}, anchor=north west, draw=white!80.0!black},
1110
tick align=outside,
1211
tick pos=left,
13-
x grid style={white},
14-
xmajorgrids,
12+
x grid style={white!69.01960784313725!black},
1513
xmin=-0.2, xmax=4.2,
16-
xtick style={color=white!33.33333333333333!black},
17-
y grid style={white},
18-
ymajorgrids,
19-
ymin=0.85, ymax=4.15,
20-
ytick style={color=white!33.33333333333333!black}
14+
xtick style={color=black},
15+
y grid style={white!69.01960784313725!black},
16+
ymin=0.8, ymax=5.2,
17+
ytick style={color=black}
2118
]
2219
\addplot [semithick, red, const plot mark right]
2320
table {%
@@ -55,6 +52,15 @@
5552
4 2
5653
};
5754
\addlegendentry{mid}
55+
\addplot [semithick, color1, mark=*, mark size=3, mark options={solid}, only marks]
56+
table {%
57+
0 2
58+
1 3
59+
2 2
60+
3 5
61+
4 3
62+
};
63+
\addlegendentry{default}
5864
\end{axis}
5965

6066
\end{tikzpicture}

0 commit comments

Comments
 (0)