TeX - LaTeX Asked on February 8, 2021
I’m using this code
begin{document}
defxmin{5}
defxmax{6}
defdomfactor{4}
defxmindom{xmin/domfactor}
defxmaxdom{xmin*domfactor}
{color{fg}
begin{tikzpicture}
begin{axis}[
title={20dB Coupler (5-6$,si{GHz}$)},
xlabel={$f$ (GHz)},
ylabel={$S$ ($si{dB}$)},
axis y line*=left,
xmin=xmin, xmax=xmax,
grid=major,
]
addplot [
red,
] table[x=freq, y=s31] {data/openems_coupler.dat};
end{axis}
begin{axis}[
ylabel={Directivity ($si{dB}$)},
axis y line*=right,
axis x line=none,
xmin=xmin, xmax=xmax,
]
addplot [
orange,
] table[x=freq, y expr={thisrow{s31}-thisrow{s41}}] {data/openems_coupler.dat};
end{axis}
end{tikzpicture}
}
end{document}
to create the following plot:
Something bugs me slightly about this, however. I’d like to have the right axis set so that the tick marks appear at the same vertical positions as the left tick marks, which would cause the grid to apply to both sides of the plot. I could, of course, omit the grid, but I like having it there.
Does pgfplots
provide a way to do this, or would I have to attempt it manually (by setting ymin and max and tick set)?
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP