# Drawing coaxial cables: TikZ or pstricks

I want to draw this. I don't find any way to do

\begin{document}
\newcommand\innenleiter[3]{%
\tikzset{Cylin/.style={cylinder, draw, cylinder uses custom fill,
cylinder end fill = brown, cylinder body fill = brown, minimum height =2cm,
minimum width = 0.5cm, opacity = 1, aspect = 2.5}}
\node[Cylin] (#3) at (#1,#2) {};
}
\newcommand\dielektrikum[3]{%
\tikzset{Cylin/.style={cylinder, draw, cylinder uses custom fill,
cylinder end fill = gray, cylinder body fill = gray, minimum height =3cm,
minimum width = 2cm, opacity = 1, aspect = 2.5}}
\node[Cylin] (#3) at (#1,#2) {};
}

\newcommand\aussenleiter[3]{%
\tikzset{Cylin/.style={cylinder, draw, cylinder uses custom fill,
cylinder end fill = brown, cylinder body fill = brown, minimum height =3cm,
minimum width = 3cm, opacity = 1, aspect = 2.5}}
\node[Cylin] (#3) at (#1,#2) {};
}

\newcommand\mantel[3]{%
\tikzset{Cylin/.style={cylinder, draw, cylinder uses custom fill,
cylinder end fill = black, cylinder body fill = black, minimum height =3cm,
minimum width = 4cm, opacity = 1, aspect = 2.5}}
\node[Cylin] (#3) at (#1,#2) {};
}

\begin{tikzpicture}[]
\tikzset{>=latex}
\draw[->] (1,0,0)--(2,0,0) node[right] {$x$};
\draw[->] (0,1,0)--(0,2,0) node[right] {$y$};
\draw[->] (0,0,1)--(0,0,2) node[left] {$z$};

\begin{scope}[canvas is zy plane at x=4]
\mantel{0}{0}{};
\end{scope}
\begin{scope}[canvas is zy plane at x=6]
\aussenleiter{0}{0}{};
\end{scope}
\begin{scope}[canvas is zy plane at x=8.4]
\dielektrikum{0}{0}{};
\end{scope}
\begin{scope}[canvas is zy plane at x=10.4]
\innenleiter{0}{0}{};
\end{scope}

\end{tikzpicture}
\end{document}

• Ehm... What this images are? Can you clearly state and divide what you want and what you tried... – m0nhawk Oct 14 '14 at 13:08
• Where's your preamble? – Holene Oct 14 '14 at 13:59
• I m trying to do this Koaxial Cables... I tried look the Code and pictures but noway... i can't – Momo Th Oct 14 '14 at 14:04

This should be a starting point. I am colour blind at the moment.

\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes.geometric,calc}
\tikzset{my cylinder/.style={cylinder, cylinder uses custom fill,rotate=-30,outer sep=0pt}
}
\begin{document}

\begin{tikzpicture}[]
\node [my cylinder,shape aspect=1,minimum width=5mm,minimum height=1cm, cylinder body fill=lightgray!20,cylinder end fill=lightgray!50] (c1) at (0,0){};
\node [my cylinder,shape aspect=0.7,minimum width=4mm,minimum height=1cm, cylinder body fill=red!20,cylinder end fill=red!50,anchor=west,xshift=-0.5mm] (c2) at ($(c1.after top)!0.5!(c1.before top)$){};
\node [my cylinder,shape aspect=0.5,minimum width=3mm,minimum height=1cm, cylinder body fill=magenta!20,cylinder end fill=magenta!50,anchor=west,xshift=-0.5mm] (c3) at ($(c2.after top)!0.5!(c2.before top)$){};
\node [my cylinder,shape aspect=0.4,minimum width=2mm,minimum height=1cm, cylinder body fill=blue!20,cylinder end fill=blue!50,anchor=west,xshift=-0.25mm] (c4) at ($(c3.after top)!0.5!(c3.before top)$){};
\draw (c1.north) -- +(60:0.5cm)node[font=\tiny,pos=1.2]{4};
\draw ([yshift=-1mm]c2.base) -- +(240:0.5cm)node[font=\tiny,pos=1.2]{3};
\draw ([yshift=1mm]c3.center) -- +(60:0.5cm)node[font=\tiny,pos=1.2]{2};
\draw ([yshift=-1mm]c4.base) -- +(240:0.5cm)node[font=\tiny,pos=1.2]{1};
\end{tikzpicture}
\end{document}


\documentclass[border=5pt]{standalone}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[]
\clip (-2,-1.1) rectangle (1,1.5);
\begin{scope}[rotate=-30]
\fill[gray!30] (-3,-1) rectangle (0,1);
\fill[gray!20] (0,0) circle(1cm);
\begin{scope}
\clip(0,0) circle(1cm);
\fill[gray!40] (-3,-0.2) rectangle (0,0.2);
\fill[gray!50] (0,0) circle(2mm);
\end{scope}
\draw[-stealth] (120:1) -- node[right,font=\tiny]{$U$}(120:0.2);
\draw[stealth-] ([yshift=-0.5\pgflinewidth]0,1) -- node[above,font=\tiny]{$I$}([yshift=-0.5\pgflinewidth]0.5,1);
\draw[-stealth] ([yshift=-0.5\pgflinewidth]0,0) -- node[above,font=\tiny]{$I$}([yshift=-0.5\pgflinewidth]0.5,0);
\end{scope}

\end{tikzpicture}
\end{document}


• Thanks very mush! I will try my other pictures with the new knewledge! Really thanks! – Momo Th Oct 14 '14 at 18:50
• another question. Now i m able to use clip and to drow some good pictures. But i have a problem! every time when i make a new document it works with "\documentclass[border=5pt]{standalone}" but when i need to make my tikzpicture in a document with chapters and other things it doesnt work! can you help me? – Momo Th Oct 14 '14 at 19:17
• @MomoTh You should try to figure out exactly what the problem is and then post it as a new question. – gerrit Oct 14 '14 at 22:50
• Color blind "at the moment"? – imallett Oct 15 '14 at 5:22
• @GraphicsResearch Did you see the photo in the OP? I was too lazy to bring that effect with colors and fadings. Hence I took that cover to hide my laziness. I felt that how to get the real color effect deserves to be a separate question. :-) BTW, I am not colour blind ;-) – user11232 Oct 15 '14 at 5:59