Examples of PGFPlots package for LaTeX
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
474 B

  1. \documentclass[border=10pt]{standalone}
  2. \usepackage{pgfplots}
  3. \pgfplotsset{width=10cm, compat=1.9}
  4. \begin{document}
  5. \begin{tikzpicture}
  6. \begin{axis}[
  7. %axis lines=both,
  8. xlabel=$x$,
  9. ylabel=$f(x)$
  10. ]
  11. \addplot[
  12. color=red,
  13. domain=-10:10,
  14. samples=10,
  15. mark=*
  16. ]{x^2-2*x-1};
  17. \addlegendentry{$x^2-2x-1$}
  18. \addplot[
  19. color=blue,
  20. domain=-10:10,
  21. samples=10,
  22. mark=square %pentagon%square
  23. ]{x^2+2*x-1};
  24. \addlegendentry{$x^2+2x-1$}
  25. \end{axis}
  26. \end{tikzpicture}
  27. \end{document}