My tex file is given as this.
Code: Select all
\documentclass[11pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage{pgfplots}
\pgfplotsset{
compat=newest,
xlabel near ticks,
ylabel near ticks
}
\usepackage{filecontents}
\begin{filecontents*}{lopass.dat}
x y
100 10
200 10
300 10
400 10
500 9
1000 6.5
2000 4.2
4000 2.4
6000 1.6
8000 1.2
10000 0.75
\end{filecontents*}
\begin{document}
\begin{tikzpicture}
\begin{semilogxaxis}[
xlabel={Frequency (Hz)},
ylabel={Gain}
]
\addplot[only marks,blue!50] table[y expr=\thisrow{y}/10.0] {lopass.dat};
\addplot[raw gnuplot,smooth] gnuplot {
plot "lopass.dat" using ($1):($2/10.0) smooth sbezier
};
\end{semilogxaxis}
\end{tikzpicture}
\end{document}
Code: Select all
unset key
set logscale x
set yrange [0:1.2]
set xrange [80:11.5e3]
set xlabel "Frequency (Hz)"
set ylabel "Gain"
set title "Frequency Response of a Low Pass Filter"
plot "lowpass.dat" using ($1):($2/10.) with points, \
"lowpass.dat" using ($1):($2/10.) smooth sbezier
Code: Select all
#f A
100 10
200 10
300 10
400 10
500 9
1000 6.5
2000 4.2
4000 2.4
6000 1.6
8000 1.2
10000 0.75