4

Is such a diagram called classification diagram? Is there any package in LaTeX which helps in drawing it directly like parent child diagrams?

enter image description here

  • 3
    The name of this sort of graphs not so important, more important is, what you do to draw it so far? For drawing of such programs exist many packages, from tikz (see examples in texample.net) to pstricks. The first one has huge but good manual, where you will find similar graphs as examples. – Zarko Jan 26 '16 at 8:09
10
\documentclass{standalone}
\usepackage{tikz}
  \usetikzlibrary{shapes,arrows,fit,calc,positioning}
  \tikzset{box/.style={draw, rectangle, thick, text centered, minimum height=3em}}
  \tikzset{line/.style={draw, thick, -latex'}}
\begin{document}
    \begin{tikzpicture}[auto]
        \node [box]                                    (inv)      {Inventory};
        \node [box, below=0.5cm of inv]                (deter)    {Deterioration};
        \node [box, right=0.5cm of deter]              (noobs)    {No Obsolescence/Deterioration};
        \node [box, left=0.5cm of deter]               (obs)      {Obsolescence};
        \node [box, below=1.5cm of deter, xshift=-2cm] (decay)    {Decaying products};
        \node [box, below=1.5cm of deter, xshift=2cm]  (per)      {Perishable Products};
        \node [box, below=1.5cm of per, xshift=2cm]    (fix)      {Fixed Lifetime};
        \node [box, below=1.5cm of per, xshift=-2cm]   (cont)     {Continuously Deteriorating};

        \path [line] (inv)   --    (deter);
        \path [line] (inv)   -|    (noobs);
        \path [line] (inv)   -|    (obs);
        \path [line] (deter) --    (per);
        \path [line] (deter) --    (decay);
        \path [line] (per)   --    (cont);
        \path [line] (per)   --    (fix);

    \end{tikzpicture}
\end{document}

enter image description here

\documentclass{standalone}
\usepackage{tikz}
  \usetikzlibrary{shapes,arrows,fit,calc,positioning}
  \tikzset{box/.style={draw, rectangle, thick, text centered, minimum height=3em}}
  \tikzset{line/.style={draw, thick, -latex'}}
\begin{document}
    \begin{tikzpicture}[auto]
        \node [box]                                     (inv)      {Inventory};
        \node [box, below=0.5cm of inv]                 (deter)    {Deterioration};
        \node [box, right=0.5cm of deter]               (noobs)    {No Obsolescence/Deterioration};
        \node [below=0.5cm of deter]                    (vuoto1)   {};
        \node [box, left=0.5cm of deter]                (obs)      {Obsolescence};
        \node [box, below=0.5cm of vuoto1, xshift=-2cm] (decay)    {Decaying products};
        \node [box, below=0.5cm of vuoto1, xshift=2cm]  (per)      {Perishable Products};
        \node [below=0.5cm of per]                      (vuoto2)   {};
        \node [box, below=0.5cm of vuoto2, xshift=2cm]  (fix)      {Fixed Lifetime};
        \node [box, below=0.5cm of vuoto2, xshift=-2cm] (cont)     {Continuously Deteriorating};

        \path [line] (inv)      --    (deter);
        \path [line] (inv)      -|    (noobs);
        \path [line] (inv)      -|    (obs);
        \path [line] (deter)    --    (vuoto1);
        \path [line] (vuoto1)   -|    (decay);
        \path [line] (vuoto1)   -|    (per);
        \path [line] (per)      --    (vuoto2);
        \path [line] (vuoto2)   -|    (cont);
        \path [line] (vuoto2)   -|    (fix);

    \end{tikzpicture}
\end{document}

enter image description here

Edit: Substituting

\node [below=0.5cm of deter]                    (vuoto1)   {};

and

\node [below=0.5cm of per]                      (vuoto2)   {};

with

\coordinate [below=0.5cm of deter]                    (vuoto1)   {};

and

\coordinate [below=0.5cm of per]                      (vuoto2)   {};

yields

enter image description here

7

Here is a starting point with the forest package. This is actually a package for linguistic trees, but can be used for multiple purposes.

\documentclass{article}
\usepackage{forest}
\begin{document}
\begin{forest}
  for tree={edge=->}
  [Inventory
    [Obsolecence]
    [Deterioration
      [Decaying products]
      [Perishable Products
        [Continuously Deteriorating]
        [Fixed Lifetime]
      ]
    ]
    [No Obsolenscence/Deterioration]
  ]
\end{forest}
\end{document}

enter image description here

The same with the TikZ graphdrawing libraries. Needs luatex.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{graphs,graphdrawing}
\usegdlibrary{trees}
\begin{document}
\begin{tikzpicture}
  \graph[tree layout] {
  "Inventory" ->
    {
      "Obsolecence",
      "Deterioration" ->
      {
        "Decaying products",
        {
          "Perishable Products" ->
          {
            "Continuously Deteriorating",
            "Fixed Lifetime"
          },
        }
      },
      "No Obsolenscence/Deterioration"
    }
  };
\end{tikzpicture}
\end{document}

enter image description here

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.