3

The following LaTeX code creates a redundant and unwanted arrow head in the Measures block.

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows,positioning,shapes.geometric}
\begin{document}
    \begin{tikzpicture}[>=latex']
        \tikzset{block/.style= {draw,rectangle,align=center,minimum width=2cm,minimum height=1cm}}
        \node [block]     (measures)  {Measures};

        \node [block, above right =2cm of measures](accuracy)   {Accuracy};
        \node [block, below =0.5cm of accuracy]       (precision)     {Precision};
        \node [block, below =0.5cm of precision]      (recall)        {Recall};
        \node [block, below =0.5cm of recall]         (fmeasure)      {Fmeasure};

        \path[draw,->] 
            (measures.east) edge (accuracy.west)
            (measures.east) edge (precision.west)
            (measures.east) edge (recall.west)
            (measures.east) edge (fmeasure.west)
        ;
    \end{tikzpicture}
\end{document}

The code produces following image.

Redundant arrow head

Is there a way to get rid of that?

5

edge is a beast so you should ride on it carefully. Use -> in the option of edge not \draw:

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows,positioning,shapes.geometric}
\begin{document}
    \begin{tikzpicture}[>=latex']
        \tikzset{block/.style= {draw,rectangle,align=center,minimum width=2cm,minimum height=1cm}}
        \node [block]     (measures)  {Measures};

        \node [block, above right =2cm of measures](accuracy)   {Accuracy};
        \node [block, below =0.5cm of accuracy]       (precision)     {Precision};
        \node [block, below =0.5cm of precision]      (recall)        {Recall};
        \node [block, below =0.5cm of recall]         (fmeasure)      {Fmeasure};

        \path[draw]
            (measures.east) edge[->] (accuracy.west)
            (measures.east) edge[->] (precision.west)
            (measures.east) edge[->] (recall.west)
            (measures.east) edge[->] (fmeasure.west)
        ;
    \end{tikzpicture}
\end{document}

enter image description here

4

A forest solution which automatically constrains the edge options:

\documentclass[tikz,border=5pt]{standalone}
\usepackage{forest}
\usetikzlibrary{arrows.meta}
\begin{document}
  \begin{forest}
    for tree={
      grow'=0,
      parent anchor=east,
      child anchor=west,
      draw,
      minimum width=20mm,
      minimum height=10mm,
      edge={-{Latex}},
      l sep+=10mm,
    }
    [Measures
      [Accuracy]
      [Precision]
      [Recall]
      [F measure]
    ]
  \end{forest}
\end{document}

plain tree

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.