sin(1:x).tex 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. \documentclass{article}
  2. \usepackage[pdftex,active,tightpage]{preview}
  3. \setlength\PreviewBorder{2mm}
  4. \usepackage{pgfplots}
  5. \usepackage{tikz}
  6. \usetikzlibrary{arrows, positioning, calc}
  7. \begin{document}
  8. \begin{preview}
  9. \begin{tikzpicture}
  10. \begin{axis}[
  11. axis x line=middle,
  12. xmode=log, % Logarithmic x axis
  13. xmin=0.01, xmax=1, % Positive domain...
  14. xticklabel=\pgfmathparse{exp(\tick)}\pgfmathprintnumber{\pgfmathresult},
  15. xticklabel style={/pgf/number format/.cd,fixed}, % Use fixed point notation
  16. width=15cm, height=8cm, % size of the image
  17. grid = major,
  18. grid style={dashed, gray!30},
  19. ymin=-1, % start the diagram at this y-coordinate
  20. ymax= 1, % end the diagram at this y-coordinate
  21. axis background/.style={fill=white},
  22. ylabel=y,
  23. xlabel=x,
  24. legend style={at={(0.9,0.95)}, anchor=north}
  25. ]
  26. \addplot[domain=0.01:1, red, thick,samples=2000] {-sin(deg(1/(x)))};
  27. \legend{$\sin(\frac{1}{x})$}
  28. \end{axis}
  29. \end{tikzpicture}
  30. \end{preview}
  31. \end{document}