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'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}
share|improve this question
    
Could you please reduce your example to a minimal working example (MWE). –  N.N. Sep 22 '11 at 20:30
    
Okay, I did that. –  Halime Sep 22 '11 at 20:36
    
It's not minimal yet. There are still packages that don't seem to be related to your problems. Have a look at the link I provided. –  N.N. Sep 22 '11 at 20:38
    
The only packages I have are lmodern, tikz, and pgfplots. –  Halime Sep 22 '11 at 20:39
    
@Halime: I was just about to post an answer to your new question regarding the regression line. Have you figured out how to use the regression parameters yourself? –  Jake Sep 23 '11 at 3:37
show 3 more comments

1 Answer

up vote 6 down vote accepted

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}
share|improve this answer
    
Thanks alot for your help! Also, what page of the manual are you citing? I'd just like to read more on that for my own reference. –  Halime Sep 22 '11 at 21:38
add comment

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.