Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

PGF Plot

By: a guest on Dec 22nd, 2011  |  syntax: Latex  |  size: 0.77 KB  |  views: 98  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. \documentclass[10pt,a4paper]{article}
  2. \usepackage[hmargin=3cm,vmargin=2cm]{geometry}
  3. \usepackage{tikz}
  4. \usepackage{pgfplots}
  5.  
  6. \begin{document}
  7. \begin{figure}[h!tbp]
  8. \centering
  9. \begin{tikzpicture}
  10. \begin{axis}[
  11.    scale only axis,
  12.    grid=major,
  13.    grid style={dashed, gray!35},
  14.    axis lines=middle,
  15.    inner axis line style={=>},
  16.    xlabel={\large $x$},
  17.    ylabel={\large $y$},
  18.    ytick={-3,-2,...,4},
  19.    xticklabel style={anchor=north west},
  20.    xtick={-3,-2,...,7},
  21.    ymin=-3.5,
  22.    ymax=4.8,
  23.    xmin=-3.5,
  24.    xmax=7.6,
  25. ]
  26. \addplot[color=red,thick,samples=50] {0.5*x^2-2*x};
  27. \addplot [only marks,fill=blue] coordinates {(0,0) (4,0)};
  28. \addplot [only marks,fill=green] coordinates {(2,-2)};
  29. \end{axis}
  30. \end{tikzpicture}
  31. \end{figure}
  32. \end{document}
clone this paste RAW Paste Data