2

I developed an Ishikawa diagram in latex, but I can´t rotate 90° to see vertical picture in PDF. Please Help me. Following the code:

\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=\scriptsize}}
\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) {
Detección &  & Legislación  & \\
         &         &             & Pesca IUU \\
 Económico  &   & Pescadores     & \\
};
\path[very thick,
  toarr/.style={->, shorten <=+0pt, shorten >=+.1cm},
  fromarr/.style={<-, shorten >=+0pt, shorten <=+.1cm}]

  % Mid left to right arrow
  [toarr]
  (m-1-1|-m-2-4) edge (m-2-4)

  % The Cause 1 arrows
  (m-1-1) edge[xslant=-.5]
    coordinate[pos=.3]   (@-1-1-1)
    coordinate[pos=.45]   (@-1-1-2)
    coordinate[pos=.65]   (@-1-1-3)
    coordinate[near end] (@-1-1-4) (m-1-1|-m-2-4)
  [fromarr]
  (@-1-1-1) edge node[above, level_2]{\textbf{↓} Efectividad } ++ (left:4.5cm)
  (@-1-1-2) edge node[above, level_2]{\textbf{↓} Disponibilidad } ++ (right:4.5cm)
   (@-1-1-3) edge node[above, level_2]{Desconocimiento } ++ (left:4.5cm)
  (@-1-1-4) edge node[above, level_2]{\textbf{\textbf{↓}} Disponibilidad } ++ (right:4.5cm)
  
 
  % The Cause 3 arrows
  (m-1-3) edge[xslant=-.5]
    coordinate[pos=.3]   (@-1-3-1)
    coordinate[near end] (@-1-3-2) (m-1-3|-m-2-4)
  [fromarr]
  (@-1-3-1) edge node[above, level_2]{\textbf{↓} Severidad } ++ (left:4cm)
  (@-1-3-2) edge node[above, level_2]{\textbf{↓} Acuerdos } ++ (right:4.5cm)

  % The Cause 4 arrows
  (m-3-1) edge[xslant=.5]
    coordinate[pos=.3]   (@-3-1-1)
    coordinate[pos=.45]   (@-3-1-2)
    coordinate[pos=.65]   (@-3-1-3)
    coordinate[near end] (@-3-1-4) (m-3-1|-m-2-4)
  [fromarr]
  (@-3-1-1) edge node[above, level_2]{Alto } ++ (left:4cm)
  (@-3-1-2) edge node[above, level_2]{Precio } ++ (right:4cm)
  (@-3-1-3) edge node[above, level_2]{Baja } ++ (left:4.5cm)
  (@-3-1-4) edge node[above, level_2]{Operación} ++ (right:4cm)
  
 

   % The Cause 6 arrows
  (m-3-3) edge[xslant=.5]
    coordinate[pos=.3]   (@-3-3-3)
    coordinate[pos=.5]   (@-3-3-2)
    coordinate[near end] (@-3-3-1) (m-3-3|-m-2-4)
  [fromarr]
  (@-3-3-1) edge node[above, level_2]{Nivel } ++ (left:4cm)
  (@-3-3-2) edge node[above, level_2]{Nivel } ++ (right:4cm)
  (@-3-3-3) edge node[above, level_2]{Presión } ++ (left:4cm);
\end{tikzpicture}
\end{document}
 

1
  • you can try this \begin{tikzpicture}[rotate=90,transform shape] \matrix[ matrix of nodes, nodes={rotate=90}, ..... However, I think you can use plain TikZ, i.e., node instead matrix
    – Black Mild
    Jul 9 '20 at 23:52
0

With this library was possible to find a solution using rotating package:

Following the correct code:

\documentclass[11pt,a4paper]{report}

\usepackage{rotating}
\usepackage{tikz}
\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=\scriptsize}}
\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{sidewaysfigure}[t]
    \centering  
    \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) {
    Title 1 &  & Title 2 & \\
             &         &             & Effect \\
    Title 3  &   & Title 4     & \\
    };
    \path[very thick,
      toarr/.style={->, shorten <=+0pt, shorten >=+.1cm},
      fromarr/.style={<-, shorten >=+0pt, shorten <=+.1cm}]
    
      % Mid left to right arrow
      [toarr]
      (m-1-1|-m-2-4) edge (m-2-4)
    
      % The Cause 1 arrows
      (m-1-1) edge[xslant=-.5]
        coordinate[pos=.3]   (@-1-1-1)
        coordinate[pos=.45]   (@-1-1-2)
        coordinate[pos=.65]   (@-1-1-3)
        coordinate[near end] (@-1-1-4) (m-1-1|-m-2-4)
      [fromarr]
      (@-1-1-1) edge node[above, level_2]{\textbf{↓} Subtitle} ++ (left:2 cm)
      (@-1-1-2) edge node[above, level_2]{\textbf{↓} subtitle} ++ (right:2 cm)
       (@-1-1-3) edge node[above, level_2]{subtitle} ++ (left:2 cm)
      (@-1-1-4) edge node[above, level_2]{\textbf{\textbf{↓}} subtitle} ++ (right:2 cm)
      
     
      % The Cause 3 arrows
      (m-1-3) edge[xslant=-.5]
        coordinate[pos=.3]   (@-1-3-1)
        coordinate[near end] (@-1-3-2) (m-1-3|-m-2-4)
      [fromarr]
      (@-1-3-1) edge node[above, level_2]{\textbf{↓} subtitle} ++ (left:2 cm)
      (@-1-3-2) edge node[above, level_2]{\textbf{↓} subtitle} ++ (right:2 cm)
    
      % The Cause 4 arrows
      (m-3-1) edge[xslant=.5]
        coordinate[pos=.3]   (@-3-1-1)
        coordinate[pos=.45]   (@-3-1-2)
        coordinate[pos=.65]   (@-3-1-3)
        coordinate[near end] (@-3-1-4) (m-3-1|-m-2-4)
      [fromarr]
      (@-3-1-1) edge node[above, level_2]{subtitle} ++ (left:2 cm)
      (@-3-1-2) edge node[above, level_2]{subtitle} ++ (right:2 cm)
      (@-3-1-3) edge node[above, level_2]{subtitle} ++ (left:2 cm)
      (@-3-1-4) edge node[above, level_2]{subtitle} ++ (right:2 cm)
      
     
    
       % The Cause 6 arrows
      (m-3-3) edge[xslant=.5]
        coordinate[pos=.3]   (@-3-3-3)
        coordinate[pos=.5]   (@-3-3-2)
        coordinate[near end] (@-3-3-1) (m-3-3|-m-2-4)
      [fromarr]
      (@-3-3-1) edge node[above, level_2]{subtitle} ++ (left:2cm)
      (@-3-3-2) edge node[above, level_2]{subtitle} ++ (right:2cm)
      (@-3-3-3) edge node[above, level_2]{subtitle} ++ (left:2cm);
    \end{tikzpicture}
\caption{Diagrama Causa Efecto.}
\label{fig:diagrama_pescado}
\end{sidewaysfigure}

\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.