TiKZ has a whole library for drawing automata:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{automata,positioning}
\begin{document}
\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto]
\node[state,initial] (q_0) {$q_0$};
\node[state] (q_1) [above right=of q_0] {$q_1$};
\node[state] (q_2) [below right=of q_0] {$q_2$};
\node[state,accepting](q_3) [below right=of q_1] {$q_3$};
\path[->]
(q_0) edge node {0} (q_1)
edge node [swap] {1} (q_2)
(q_1) edge node {1} (q_3)
edge [loop above] node {0} ()
(q_2) edge node [swap] {0} (q_3)
edge [loop below] node {1} ();
\end{tikzpicture}
\end{document}
I have no idea what or who Visio is. Starting from Emma's answer and changing the structure to that produced by R, which I gather from your spamming is what you want, you can create a skan tree
style which formats the tree accordingly.
There are several existing answers on this site illustrating different ways to draw trees with precisely this kind of structure and branches of this shape. Please look at those if you want a different approach.
Forest is the most powerful and flexible programme to draw trees in LaTeX as far as I know, with the exception of the tree layouts supported by the graph-drawing algorithms provided by TikZ itself. Those rely on LuaTeX and will automatically layout your tree, but they obviously require a different approach which may or may not be suitable for your work-flow. The TikZ manual documents thse facilities extensively.
For example,
\documentclass[tikz,border=10pt]{standalone}
\usepackage{forest}
\usetikzlibrary{arrows.meta}
\begin{document}
% addaswyd o ateb Emma: https://tex.stackexchange.com/a/342102/
\forestset{
skan tree/.style={
for tree={
grow=0,
rounded corners,
draw,
top color=white,
bottom color=blue!20,
edge={Latex-},
child anchor=parent,
%parent anchor=children,
anchor=parent,
tier/.wrap pgfmath arg={tier ##1}{level()},
s sep+=20pt,
l sep+=20pt,
edge path'={
(.child anchor) -- ++(-20pt,0) -- (!u.parent anchor)
},
},
before typesetting nodes={
for tree={
content/.wrap value={\strut ##1},
},
},
},
}
\begin{forest}
skan tree
[Formulas
[single-line]
[multi-line
[aligned at
[relation sign]
[several places]
[center]
]
[first left]
]
]
\end{forest}
\end{document}
EDIT
You can override the alignments by overriding tier
for particular nodes. For example,
\begin{forest}
skan tree
[Formulas
[single-line
[relation sign, delay={tier/.wrap pgfmath arg={tier #1}{level("!name=sp")}}]
]
[multi-line
[aligned at
[several places, name=sp]
[center]
]
[first left]
]
]
\end{forest}
or, with spacing using a phantom
,
\begin{forest}
skan tree
[Formulas
[single-line, for children={delay={tier/.wrap pgfmath arg={tier #1}{level("!name=sp")}}}
[relation sign]
[, phantom]
]
[multi-line
[aligned at
[several places, name=sp]
[center]
]
[first left]
]
]
\end{forest}
Best Answer
You can draw such diagrams with TikZ (
tikz
package plus libraries) or PS-Tricks (pstricks
and otherpst-
packages). I personally would recommend TikZ.Here is how I would draw these diagrams: