1

I'm trying to plot touchstone (s2p) data exported from another software, but the touchstone coordinate system is rectangular. So I have to overlay a XY plot over the smith chart to get it right.

The XY chart should have the center (0,0) in the center of the smith chart, and range from (-1,-1) to (1,1). (0,1) should align at the top of the smith chart. (0,-1) should align at the bottom the smith chart. The edges should be at (+/- 1,0).

My fallback for now is the scikit-rf from python, but the output graphics is not very nice or configurable. So I would love to have it working in tikz.

The example under shows that the two don't overlap properly. Any clue how to make the normal axis environment perfectly overlap the smith chart? ?

\documentclass[margin=10pt]{standalone}
\usepackage{verbatim}
\usepackage{tikz}
\usepackage{pgf}
\usepackage{pgfplots}
\usetikzlibrary{shapes,arrows,positioning,calc}
\usetikzlibrary{pgfplots.smithchart}

\begin{document}

\begin{tikzpicture}
\begin{smithchart}[title=S]
\end{smithchart}
\begin{axis}
\addplot[color=red,mark=x] coordinates {
(-1,0)
(1,0)
(0,-1)
(0,1)
(0,0)
};
\end{axis}
\end{tikzpicture}

\end{document}
  • Welcome! Please make your code compilable. This is much more useful than a fragment as people don't have to figure out how to complete it and can copy-paste-compile to immediately reproduce the problem. Right now, your example doesn't show anything because nobody but you can compile it. I suspect this will be true even if I were to figure out how to complete it. – cfr Jun 19 '16 at 14:45
  • 1
    @cfr done!, sorry, didn't think about that. – user55924 Jun 19 '16 at 15:09
  • Great! And an answer, too ;). – cfr Jun 19 '16 at 16:15
3

Found an answer by digging in the PGFPLOTS manual, Setting the smith chart width, as it is circular to a set value, and setting the height and width of the rectangular plot made everything work out.

\documentclass[margin=10pt]{standalone}
\usepackage{verbatim}
\usepackage{tikz}
\usepackage{pgf}
\usepackage{pgfplots}
\usetikzlibrary{shapes,arrows,positioning,calc}
\usetikzlibrary{pgfplots.smithchart}

\begin{document}

\begin{tikzpicture}
\begin{smithchart}[title=S,width=10cm]
\end{smithchart}
\begin{axis}[ymax=1,ymin=-1,xmax=1,xmin=-1,hide axis, height=10cm,width=10cm]
\addplot[color=red,mark=x] coordinates {
(-1,0)
(1,0)
(0,-1)
(0,1)
(0,0)
};
\end{axis}
\end{tikzpicture}

\end{document}

In addition, this feature also exists in the smithchart package already as [is smitchart cs]

\documentclass[margin=10pt]{standalone}
\usepackage{verbatim}
\usepackage{tikz}
\usepackage{pgf}
\usepackage{pgfplots}
\usetikzlibrary{shapes,arrows,positioning,calc}
\usetikzlibrary{pgfplots.smithchart}

\begin{document}
\begin{tikzpicture}
\begin{smithchart}[title=S]
\addplot[is smithchart cs,green] coordinates{
(-1,0)
(1,0)
(0,-1)
(0,1)
(0,0)
};
\end{smithchart}
\end{tikzpicture}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.