Advertisement
Guest User

PGF Plot

a guest
Dec 22nd, 2011
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 0.77 KB | None | 0 0
  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}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement