[Tex/LaTex] TikZ Automata Make An Arrow To Nowhere

automatatikz-pgf

I have the following TikZ code:

\documentclass{standalone} 
\usepackage{tikz}
\usetikzlibrary{arrows,automata} 
\begin{document}
    \begin{tikzpicture}[shorten >=1pt,node distance=2cm,>=stealth',thick]
        \node[state] (1) {$1$};
        \node[state,draw=none] (d1) [left of=1] {};
        \draw [->] (1) to[loop above] node[auto] {} (1);
        \draw [->] (1) to[bend left] node[auto] {} (d1);
    \end{tikzpicture}
\end{document}

which produces this image:

TikZ output

Notice, that I've used a hidden node (d1) above in order to produce the nice arrow going to the left.

The sadness of this is that now I have a big circle-sized empty space.

I'd like to keep the arrow, I'd like the arrow to look the same, but I'd like to get rid of that empty space.

Is there a way to draw the arrow without introducing the invisible node? Or is there a way to crop the figure? What's an elegant way to solve this problem?

Thanks!

Best Answer

You can use a \coordinate instead of a \node:

\documentclass{standalone} 
\usepackage{tikz}
\usetikzlibrary{arrows,automata} 
\begin{document}
    \begin{tikzpicture}[shorten >=1pt,node distance=2cm,>=stealth',thick]
        \node[state] (1) {$1$};
        \coordinate[left of=1] (d1);
        \draw [->] (1) to[loop above] node[auto] {} (1);
        \draw [->] (1) to[bend left] node[auto] {} (d1);
    \end{tikzpicture}
\end{document}

enter image description here

To compensate for the arrow tip shortening, you could use

   \draw [->,shorten >=0pt] (1) to[bend left] node[auto] {} (d1);

in the above code.