Well, I see you are in the process of adapting to pgfplot
. I'd be glad to help you. I'll post source code as well as the result of my compiling (I'm using TeXLive). I suggest you to use plain tikz
before pgfplot
instead, as it is more beginner-friendly and doesn't involve a plethora of long functions. Because of this, I'll be using plain tikz
. Of course, If you insist on pgfplots
solution, I'll post that as well, just let me know.
Anyway, here's the tikz
code:
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\begin{document}
\begin{center}
\begin{tikzpicture}
\draw (0,0) -- (10,0);
\node at (-0.3,0) {$\cdots$};
\node at (10.3,0) {$\cdots$};
\node at (2,0) {$|$};
\node at (4,0) {$|$};
\node at (6,0) {$|$};
\node at (8,0) {$|$};
\node at (10,0) {$|$};
\node at (2,-2) {$|$};
\node at (2,-0.5) {$s_{k-2}$};
\node at (4,-0.5) {$s_{k-1}$};
\node at (6,-0.5) {$s_{k}$};
\node at (8,-0.5) {$s_{k+1}$};
\node at (2,-2) {$\bullet$};
\draw[->] (2,-2) to node [below] {$z$}(7.2,-2);
\draw node at (-0.3,1) {$\cdots$};
\draw (0,1) to node [above] {$u_{k-3}$}(7.2,1);
\draw[dashed] (7.2,-2.5) to (7.2,1);
\draw (7.2,1) -- (7.2,2.5);
\draw(7.2,2.5) to node [above] {$u_{k-2}$}(10.5,2.5);
\node at (10.8,2.5) {$\cdots$};
\end{tikzpicture}
\end{center}
\end{document}

I know it's a little primitive, especially the |
spam part (if I used the right commands I would get the same result with only one line of code), but I can't avoid such examples, as I want to show you simplicity sometimes is the right decision, especially for newcomers. Please don't feel offended by the fact that I posted tikz
and not pgfplot
solution. From experience I sensed my decision of presenting a less complex solution would be of benefit to you.
Have a good day.