2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-29 15:57:57 +02:00
LaTeX-examples/tikz/sin(1:x)/sin(1:x).tex

35 lines
1.1 KiB
TeX
Raw Normal View History

2012-09-18 16:33:25 +02:00
\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{2mm}
2012-09-18 15:13:30 +02:00
2012-09-18 16:33:25 +02:00
\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{arrows, positioning, calc}
\begin{document}
\begin{preview}
\begin{tikzpicture}
\begin{axis}[
axis x line=middle,
2012-09-18 16:33:25 +02:00
xmode=log, % Logarithmic x axis
xmin=0.01, xmax=1, % Positive domain...
xticklabel=\pgfmathparse{exp(\tick)}\pgfmathprintnumber{\pgfmathresult},
xticklabel style={/pgf/number format/.cd,fixed}, % Use fixed point notation
width=15cm, height=8cm, % size of the image
grid = major,
grid style={dashed, gray!30},
2012-09-18 16:33:25 +02:00
ymin=-1, % start the diagram at this y-coordinate
ymax= 1, % end the diagram at this y-coordinate
axis background/.style={fill=white},
ylabel=y,
xlabel=x,
legend style={at={(0.9,0.95)}, anchor=north}
]
\addplot[domain=0.01:1, red, thick,samples=2000] {-sin(deg(1/(x)))};
\legend{$\sin(\frac{1}{x})$}
\end{axis}
\end{tikzpicture}
\end{preview}
\end{document}