# domain option for pgfplot's \addplot ignored?

I want to do a simple plot of goniometric functions with pgf in a beamer presentation:

\usepackage{tikz,pgfplots}
% ...
\begin{tikzpicture}
\end{tikzpicture}


The domain options seems to be ignored, x axis spans from -6 to +6 regardless of what I specify. I tried to use /pgf/domain instead, with no change. What am I missing?

-
It works for me as intended that is from 0 to pi. Is it possible that you complete your code to a compilable full example? –  percusse Nov 7 '11 at 11:11
This code works for me with a correct domin, perhaps check your pgfplot version (\listfiles) and update. I used version 1.4.1, the most recent one is 1.5. –  Stefan Kottwitz Nov 7 '11 at 11:14
I am unfrotunately at Ubuntu which still has TeXlive 2009, with pgfplots 1.2.2. Thanks for answers. Is there a way to close the question? Or can @Stefan Kottwitz convert the comment to answer? –  eudoxos Nov 7 '11 at 12:05
@eudoxos I added an answer. Perhaps somebody having the same problem might find this question with google and so sees the update recommendation. –  Stefan Kottwitz Nov 7 '11 at 12:34

The code works, tested with pgfplots version 1.4.1.

On Ubuntu the current version from the repositories is 1.2.2, as the OP commented, which should be the cause. So an upgrade of pgfplots is recommended, which could be done manually from CTAN the most recent version is 1.5. However, when upgrading I recommend upgrading also the PGF package to the most recent version, for best compatibility.

-
I upgraded to vanilla TeXLive and it works now. Thanks for tip. –  eudoxos Nov 7 '11 at 13:27

Have you tried passing the domain option to tikzpicture instead of to the \addplot command? Works for me with 1.2.2.

\documentclass{article}

\usepackage{tikz}
\usepackage{pgf}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}[domain=0:50]
\begin{axis}[ xlabel=$x$,
ylabel=$y$ ]