# Join point by using Tikz in Beamer document class

I know my question is trivial. By the way, I can not show points given by their coordinates with a Bezier curve using Tikz.

    \documentclass{article}

\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\draw [<->,thick] (0,2) node (yaxis) [above] {$y$}
|- (3,0) node (xaxis) [right] {$x$};
%\draw [gray!50]  (0,0) -- (1,1) -- (3,1) -- (1,0)  -- (2,-1) -- cycle;
\draw [red] plot [smooth] coordinates {(0,0) (1,1) (1.5, 1.5) (2,1.5) (2.5,2) (3,1) (1,0) (2,-1)};

%\draw [gray!50, xshift=4cm]  (0,0) -- (1,1) -- (2,-2) -- (3,0);
%\draw [cyan, xshift=4cm] plot [smooth, tension=2] coordinates { (0,0) (1,1) (2,-2) (3,0)};
\end{tikzpicture}
\end{document}


which gives

I would like to give a draw like this

Many thanks for any help.

-
And, yes, you can definitely use tikz in beamer. :) –  hpesoj626 Feb 22 '13 at 14:58
Just add mark=* after the smooth option. Is that what you mean? –  Jake Feb 22 '13 at 15:14
Thanks you for your answer! –  Zbigniew Feb 22 '13 at 15:53
@cmhughes: Done –  Jake Feb 22 '13 at 16:38

You can show plot the individual points by adding mark=* to the plot options, which will use a filled circle marker. There are many marker types, and they can be styled independently of the plot line (e.g. their size, colour, line thickness, etc.). Refer to the manual for more details.

\documentclass{article}

\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\draw [<->,thick] (0,2) node (yaxis) [above] {$y$}
|- (3,0) node (xaxis) [right] {$x$};
\draw [red] plot [smooth, mark=*] coordinates {(0,0) (1,1) (1.5, 1.5) (2,1.5) (2.5,2) (3,1) (1,0) (2,-1)};
\end{tikzpicture}
\end{document}

-
Thank you very much! –  Zbigniew Feb 22 '13 at 20:42
@Averroès: Thanks for accepting! In the process, you also downvoted the answer by clicking the downward pointing triangle. I assume that was by accident? In that case, would you mind undoing the downvote? –  Jake Feb 23 '13 at 16:42