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.
 

34 lines
474 B

\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{width=10cm, compat=1.9}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
%axis lines=both,
xlabel=$x$,
ylabel=$f(x)$
]
\addplot[
color=red,
domain=-10:10,
samples=10,
mark=*
]{x^2-2*x-1};
\addlegendentry{$x^2-2x-1$}
\addplot[
color=blue,
domain=-10:10,
samples=10,
mark=square %pentagon%square
]{x^2+2*x-1};
\addlegendentry{$x^2+2x-1$}
\end{axis}
\end{tikzpicture}
\end{document}