绘制图形很困难

绘制图形很困难

我必须绘制下图所示的图表,但我找不到在 LaTeX 中执行此操作的方法。

Description:

  1. 应该有三种不同类型的网络(或阶梯线):绿色、蓝色和红色。
  2. 我需要在图里面写,如图所示。
  3. 我必须把它们非常接近的地方弄暗。

代码由@gernot提供:

  \documentclass[border=2mm]{standalone}
 \usepackage{tikz}
 \usetikzlibrary{calc}

 \newcommand\wireheight{2} % height of one segment
 \newcommand\wirewidth{1}  % width of a segment
 \newcommand\wiredist{0.5} % distance between wires
 \pgfmathsetmacro\pairdist{2*(\wirewidth+\wiredist)} % distance between pairs of wires

 % \wire[options]{name}{start}{height}{width}
 \newcommand\wire[5][]%
   {\draw[#1]
     (#3)            coordinate (#2-0)
     -- ++(0,#4)     coordinate (#2-1)
     -- ++(#5,0)     coordinate (#2-2)
     -- ++(0,#4)     coordinate (#2-3)
     -- ++(-#5,0)    coordinate (#2-4)
     -- ++(0,#4)     coordinate (#2-5)
     -- ++(#5,0)     coordinate (#2-6)
     -- ++(0,0.5*#4) coordinate (#2-7);
   }

 \begin{document}
 \begin{tikzpicture}[rounded corners,>=stealth, shorten >=1pt, shorten <=1pt]
   \foreach \i in {0,...,2}
     {\wire[thick]{B-\i}{\i*\pairdist,0}{\wireheight}{\wirewidth}
      \wire[thick,green]{G-\i}{{(\i+1)*\pairdist-\wiredist},0}{\wireheight}{-\wirewidth}
     }
   \draw[<-] ($(B-0-2)!0.5!(B-0-3)$) -- +(-0.5,0);
   \draw[<-] ($(G-0-2)!0.5!(G-0-3)$) -- +(0.5,0) node[above]{5mm};
   \draw[<-] ($(G-0-4)!0.5!(G-0-5)$) -- +(-0.5,0);
   \draw[<-] ($(B-1-4)!0.5!(B-1-5)$) -- +(0.5,0) node[above]{7mm};
   \draw[<->] ($(B-1-0)!0.5!(B-1-1)$) -- node[above]{10mm} ($(G-1-0)!0.5!(G-1-1)$);
   \draw[<->] ($(G-1-2)!0.5!(G-1-3)$) -- node[above]{9mm} ($(B-2-2)!0.5!(B-2-3)$);
 \end{tikzpicture}
 \end{document}

但这仅给出两个数组

我不知道该如何继续下去。

相关内容