/
a5_4c.tex
36 lines (31 loc) · 838 Bytes
/
a5_4c.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
\documentclass[border={10pt}]{standalone}
\usepackage{tikz,pgfplots,filecontents,amsmath}
\pgfplotsset{compat=1.5}
\begin{filecontents}{data.dat}
n hn
0 2
1 -3
2 2.0
% 3 0.0
%4 0.0
% 5 0.0
\end{filecontents}
\begin{document}
\begin{tikzpicture}
\begin{axis}
[%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
axis x line=middle,
axis y line=middle,
every axis x label={at={(current axis.right of origin)},anchor=north west},
every axis y label={at={(current axis.above origin)},anchor= north west},
every axis plot post/.style={mark options={fill=black}},
xlabel={$n$},
ylabel={$\boldsymbol{h[n]}$},
xtick={-1,0,2,4},
ymin=-3,
ymax=3,
]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\addplot+[ycomb,black,thick] table [x={n}, y={hn}] {data.dat};
\end{axis}
\end{tikzpicture}
\end{document}