Латексный код Tikz Для помощи Fishbone Ishikawa - PullRequest
1 голос
/ 23 июня 2019

Я пытаюсь иметь метки для стрелок на диаграмме рыбы, как я могу текстовые метки. Я модифицировал код, чтобы он соответствовал моим потребностям, которые я нашел из https://texwelt.de/wissen/fragen/13171/ishikawa-tikz-diagram

как добавить текст над строкой, созданной (@ - \ r- \ c-2), если это не узел? что означают символы @ - \ r- \ c-2?

\documentclass[tikz]{standalone}
\usetikzlibrary{arrows,shapes.geometric,positioning,matrix}
\tikzset{
  ishikawa/.style={align=center, inner sep=0pt},
  matter/.style  ={rectangle, minimum size=6mm, very thick, draw=red!70!black!40,
    top color=white, bottom color=red!50!black!20, font=\itshape},
  level_1/.style ={ellipse, node distance=60pt, minimum size=6mm, very thick,
    draw=red!50!black!50, top color=white, bottom color=red!50!black!20, font=\itshape},
  level_2/.style={rectangle, minimum size=6mm, font=\itshape, font=\tiny}}
\tikzset{
  rows/.style 2 args={@/.style={row ##1/.style={#2}},@/.list={#1}},
  cols/.style 2 args={@/.style={column ##1/.style={#2}},@/.list={#1}},
}
\begin{document}
\begin{tikzpicture}
\matrix[
  matrix of nodes,
  row sep=3cm,
  column sep=1cm,
  rows={1,3}{nodes=level_1},
  rows=2{nodes=matter,anchor=center}
] (m) {
Material & Machine & Measurement & \\
         &          &           & CPA \\
Method  & Man   & Mother Nature     & \\
};
\path[very thick,
  to arr/.style={->, shorten <=+0pt, shorten >=+.1cm},
  fr arr/.style={<-, shorten >=+0pt, shorten <=+.1cm}]
  [to arr]
  (m-1-1|-m-2-4) edge (m-2-4)
  \foreach \r [evaluate={\xslant=\r==3?.5:-.5;}] in {1,3}{%\xslant=\r==3?.5:-.5; impacts the position of the 6 main arrows in relation to the main BONE
    \foreach \c in {1,2,3}{ %tells where to make the bones if it is only 1, then only material and method is created
      (m-\r-\c) edge[xslant=\xslant]
        coordinate[pos=.5]   (@-\r-\c-1)
    coordinate[pos=.3]   (@-\r-\c-3)%i added this one
        coordinate[near end] (@-\r-\c-2) (m-\r-\c|-m-2-4)
%------------------------------------above makes the 6 main pillers
%-----------bottom code ass the horizontal arrows to each
     %controls arrow direction
}}
 [fr arr]
 \foreach \r in {3}{ %1 or 3 moves up or down
 \foreach \c in {2}{ %1 2 or 3 controls which section 

       (@-\r-\c-2) edge ++ (left:2cm) %middle horizontals

    %(@-\r-\c-3) edge ++ (left:2cm)%i added this one
    }
  }
  \foreach \prt in {1,2}{
  (@-1-1-\prt) --
    coordinate[pos=.3]   (@1-\prt)
    coordinate[near end] (@2-\prt) ++ (left:5cm)%paper width
 % [fr arr]
 % (@1-\prt) edge ++ ([xslant=-.5]up:.8cm) % extra arrows
 % (@2-\prt) edge ++ ([xslant=-.5]up:.8cm) % extra arrows
  };
\end{tikzpicture}
\end{document}

Image of my current fishbone diagram

...