[Tex/LaTex] Specifying a domain and pgfplots

graphspgfplotstikz-pgf

I'm making a graph with pgfplots with a specific domain, but the graph's domain (both x and y) are not changing. I'm reading through the pgfplots manual and I think I'm doing the right thing except that it's not working.

Here's my code:

\documentclass{article}
\usepackage{tikz,pgfplots}

\begin{document}

\begin{tikzpicture}
  \begin{axis}[xlabel=$\mathrm{\frac{1}{[S]}}$,ylabel=$\mathrm{\frac{1}{\textit{V}_0}}$]
  \addplot+[scatter,domain=-100:10000,y domain=-0.05:0.05] coordinates {
    (10000, 0.030)
    (5000, 0.02)
    (2000, 0.014)
    (1000, 0.012)
    (500,  0.0110)
    (200,  0.0104)
    (100,  0.0102)
    (50,   0.010)
    (20,   0.01)
    (10,   0.01)
    (5,    0.01) 
  };

  \end{axis}
\end{tikzpicture}

\end{document}

Best Answer

The manual (p. 34 for version 1.5) says

The domain keys are only relevant for gnuplot and plot expression. In case you’d like to plot only a subset of other coordinate input routines, consider using the coordinate filter restrict x to domain.

That restricts the domain of the co-ordinates, but does not alter the axes you get (it effectively moves the data points). I think you just want the xmax, xmin, ymax and ymin keys, which apply to the axis:

\documentclass{article}
\usepackage{tikz,pgfplots}

\begin{document}

\begin{tikzpicture}
  \begin{axis}
    [xlabel=$\mathrm{\frac{1}{[S]}}$,ylabel=$\mathrm{\frac{1}{\textit{V}_0}}$,
    xmin=-100,xmax=10000,ymin=-0.05,ymax=0.05]
  \addplot+[scatter] coordinates {
    (10000, 0.030)
    (5000, 0.02)
    (2000, 0.014)
    (1000, 0.012)
    (500,  0.0110)
    (200,  0.0104)
    (100,  0.0102)
    (50,   0.010)
    (20,   0.01)
    (10,   0.01)
    (5,    0.01) 
  };

  \end{axis}
\end{tikzpicture}

\end{document}
Related Question