\begin{figure}[h]
\centering
\caption{Example of Semantic Trajectory}
\label{fig:trajectory}
\begin{tikzpicture}[thick,scale=1.25]
\makeatletter
\pgfmathsetseed{1}
\tikzset{
    dot diameter/.store in=\dot@diameter,
    dot diameter=3pt,
    dot spacing/.store in=\dot@spacing,
    dot spacing=10pt,
    dots/.style={
        line width=\dot@diameter,
        line cap=round,
        dash pattern=on 0pt off \dot@spacing
    }
}
\makeatother

\coordinate (p1) at (0.8,2.5);
\coordinate (p2) at (2.5,1.5);
\coordinate (p2a) at (5.2,2.0);
\coordinate (p3) at (6.0,2.0);
       
% DRWING AXIS
\draw [-latex, thick] (0, 0) -- (0, 3) node  [left] {\normalsize{$y$}};
\draw [-latex, thick] (0, 0) -- (7, 0) node  [below] {\normalsize{$x$}};

%ticks
    	\foreach \x in {0,...,6}
     		\draw (\x,1pt) -- (\x,-3pt)
			node[anchor=north,font=\footnotesize] {\x};
    	\foreach \y in {0,...,2}
     		\draw (1pt,\y) -- (-3pt,\y) 
     			node[anchor=east,font=\footnotesize] {\y};      
   
    
% DRAWING STOPS
\randpoints{(p1)}{20}{0.15}
\randpoints{(p2)}{20}{0.15}
\randpoints{(p3)}{20}{0.15}
 
% DRWAING STOPS INFORMATION
\draw (p1) circle(7pt) node[below,align=center,font=\footnotesize]{\\\\$S_1$ \\Hotel \\ \text{[8:00,10:00]}};

\draw (p2) circle(7pt) node[below,align=center,font=\footnotesize]{\\\\$S_2$ \\ Shopping Mall \\ \text{[13:00,19:00]}};

\draw (p3) circle(7pt) node[below,align=center,font=\footnotesize]{\\\\$S_3$ \\ Restaurant \\ \text{[20:00,21:30]}};

% DRAWING MOVES
\decorateline{(p1)}{(p2)}{-0.5mm}{15mm}{2}{$M_1$}
\decorateline{(p2)}{(p2a)}{+4mm}{20mm}{4}{$M_2$}
\decorateline{(p2a)}{(p3)}{+4mm}{20mm}{2}{}
\end{tikzpicture}

\end{figure}