Input words within a figure using tikz [duplicate]

I want to draw this using tikz package of latex.

I already write down the code for that. But the problem is that how could I input the sentence Happing Now within the picture.

My code is

\begin{frame}{Frame Title}
\begin{figure}
\centering
\begin{tikzpicture}
\draw[thick][->](0,0) to (4,0);
\draw[thick][->](2,1.5) to (4,0.5);
\draw[thick][loosely dotted](4,0) to (5,0);
\end{tikzpicture}
\caption{Timeline}
\label{fig:my_label1}
\end{figure}


\end{frame}

marked as duplicate by hpekristiansen, Stefan Pinnow, Sebastiano, Henri Menke tikz-pgf StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Dec 13 '18 at 1:21

• palce a node at the starting point of the arrow. Read A very minimal introduction to TikZ for more. – nidhin Dec 12 '18 at 18:50
• please show us mwe (minimal working example), which produce your arrows. – Zarko Dec 12 '18 at 18:52
• \draw[thick][->] (2,1.5) node[anchor=east]{Happing Now} to (4,0.5); – hpekristiansen Dec 12 '18 at 18:56
• @hpekristiansen: The possible duplicate question is about placing text at arbitrary positions, which would be used in this case as well (but would require specifying the coordinate twice). However, I think that that is different than this case as this is about placing text relative to a particular \draw. – Peter Grill Dec 12 '18 at 19:07

You can place a node at the appropriate point, if you replace the to syntax with a --:

Notes:

• You don't need to use [] for each option.

Code:

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\draw[thick, ->] (0,0) to (4,0);
\draw[thick, ->]  (2,1.5) -- (4,0.5) node [pos=0, anchor=east] {Happening Now};
\draw[thick, loosely dotted] (4,0) to (5,0);
\end{tikzpicture}
\end{document}


You can put a node at the beginning of the upper arrow.

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\draw[thick, ->] (0,0) to (4,0) ;
\draw[thick, ->]  (2,1.5) node [anchor=east] {Happing Now}  to (4,0.5);
\draw[thick, loosely dotted](4,0) to (5,0);
\end{tikzpicture}

\end{document}


As suggested by @nidhin:

\documentclass[tikz,border=0.5cm]{standalone}
\begin{document}
\begin{tikzpicture}
\draw[thick][->](0,0) to (4,0);
\draw[thick][->](2,1.5)node[left]{Happing now} to (4,0.5);
\draw[thick][loosely dotted](4,0) to (5,0);
\end{tikzpicture}
\end{document}


Using one command as my previous answer. Don't use a to path if you don't have different angles for in and out, just -- or edge.

\documentclass{article}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}[thick]
\path[->] (0,0) edge (4,0) (2,1.5)node[label=left:Happening Now]{} edge (4,0.5) (4,0) edge[loosely dotted,-] (5,0);
\end{tikzpicture}

\end{document}


\documentclass[12pt,a4paper]{article}
\usepackage{tikz}

\begin{document}

\begin{figure}
\centering
\begin{tikzpicture}[thick]
\draw[->]  (0,0) edge (4,0)
(2,3) node[left] {Happing Now} -- (4,1);
\draw[thick][loosely dotted] (4,0) -- (5,0);
\end{tikzpicture}
\caption{Timeline}
\label{fig:my_label1}
\end{figure}

\end{document}


• I think you spelled "Happening Now" wrong? :-). There is a a reference to [![enter image description here][1]][1] in the answer. I think you intended to delete that? – Peter Grill Dec 12 '18 at 19:11
• @PeterGrill, thank you to pointing me on this mistake. I still have problems with new interface for loading images ... i delete it, hopefully now is all correct. – Zarko Dec 12 '18 at 20:04