cos-fixpoint.tex 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. \documentclass{article}
  2. \usepackage[pdftex,active,tightpage]{preview}
  3. \setlength\PreviewBorder{0mm}
  4. \usepackage{pgfplots}
  5. \pgfplotsset{compat=1.9}
  6. \begin{document}
  7. \begin{preview}
  8. \begin{tikzpicture}
  9. \begin{axis}[
  10. axis x line=middle,
  11. axis y line=middle,
  12. enlarge y limits=true,
  13. enlarge x limits=true,
  14. xmin=0, xmax=pi, % x domain
  15. width=12cm, height=8cm, % size of the image
  16. grid = major,
  17. grid style={dashed, gray!30},
  18. ymin=-1, % start the diagram at this y-coordinate
  19. ymax= 1, % end the diagram at this y-coordinate
  20. % axis background/.style={fill=white},
  21. ylabel=$y$,
  22. xlabel=$x$,
  23. xtick={0,1.5708,3.14159},
  24. xticklabels={$0$,$\frac{\pi}{2}$,$\pi$},
  25. legend style={at={(0.2,0.37)}, anchor=north, fill=none}
  26. ]
  27. \addplot[domain=-8:8,very thick,samples=200,blue] {cos(deg(x))};
  28. \addplot[domain=-8:8,very thick,samples=200,red] {x};
  29. \coordinate (a) at (axis cs:0.739085,0.739085);
  30. \fill[red] (a) circle (3pt);
  31. \node[label={[label distance=0.1cm]0:$x = y \approx 0.739085$}] at (a) {};
  32. \legend{$\cos x$, $x$}
  33. \end{axis}
  34. \end{tikzpicture}
  35. \end{preview}
  36. \end{document}