Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

enter image description here

I would like to give a draw like this

enter image description here

Many thanks for any help.

share|improve this question
    
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

1 Answer 1

up vote 2 down vote accepted

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}
share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.