From 6d6630b2173f08f9943ca4c6255cdfba443b8720 Mon Sep 17 00:00:00 2001 From: Martin Thoma Date: Tue, 18 Sep 2012 15:13:30 +0200 Subject: [PATCH] added plot of sin(1:x) --- tikz/sin(1:x)/Makefile | 31 +++++++++++++++++++++++ tikz/sin(1:x)/sin(1:x).tex | 50 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 tikz/sin(1:x)/Makefile create mode 100644 tikz/sin(1:x)/sin(1:x).tex diff --git a/tikz/sin(1:x)/Makefile b/tikz/sin(1:x)/Makefile new file mode 100644 index 0000000..a92f6a2 --- /dev/null +++ b/tikz/sin(1:x)/Makefile @@ -0,0 +1,31 @@ +SOURCE = 'sin(1:x)' +DELAY = 80 +DENSITY = 300 +WIDTH = 500 + +make: + pdflatex $(SOURCE).tex -output-format=pdf + make clean + +clean: + rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot + +gif: + pdfcrop $(SOURCE).pdf + convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif + make clean + +png: + make + make svg + inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png + +transparentGif: + convert $(SOURCE).pdf -transparent white result.gif + make clean + +svg: + #inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg + pdf2svg $(SOURCE).pdf $(SOURCE).svg + # Necessary, as pdf2svg does not always create valid svgs: + inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg diff --git a/tikz/sin(1:x)/sin(1:x).tex b/tikz/sin(1:x)/sin(1:x).tex new file mode 100644 index 0000000..db7667c --- /dev/null +++ b/tikz/sin(1:x)/sin(1:x).tex @@ -0,0 +1,50 @@ + \documentclass{article} + \usepackage[pdftex,active,tightpage]{preview} + \setlength\PreviewBorder{2mm} + + \usepackage{pgfplots} + \usepackage{tikz} + \usetikzlibrary{arrows, positioning, calc, intersections} + + \begin{document} + + \begin{preview} + \begin{tikzpicture} + \begin{axis}[ + axis x line=middle, + axis y line=middle, + width=15cm, height=15cm, % size of the image + grid = major, + grid style={dashed, gray!30}, + %xmode=log,log basis x=10, % <- doesn't work: + % ! Missing number, treated as zero. + % + % p + % l.33 ..., red, thick,samples=500] {sin(deg(1/x))}; + % + % ? + % ! Emergency stop. + % + % p + % l.33 ..., red, thick,samples=500] {sin(deg(1/x))}; + % + % ! ==> Fatal error occurred, no output PDF file produced! + %ymode=log,log basis y=10, + xmin=-0.7000, % start the diagram at this x-coordinate + xmax=-0.0062, % end the diagram at this x-coordinate + 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, + %xticklabels={,,}, + %yticklabels={,,}, + tick align=outside, + tension=0.08, + legend style={at={(0.1,0.95)}, anchor=north} ] + \addplot[domain=-0.700:-0.0062, red, thick,samples=500] {sin(deg(1/x))}; + \legend{$\sin(\frac{1}{x})$} + \end{axis} + \end{tikzpicture} + \end{preview} + \end{document}