diff --git a/tikz/dst-end/Makefile b/tikz/dst-end/Makefile new file mode 100644 index 0000000..2c63edc --- /dev/null +++ b/tikz/dst-end/Makefile @@ -0,0 +1,31 @@ +SOURCE = dst-end +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/dst-end/README.md b/tikz/dst-end/README.md new file mode 100644 index 0000000..64859e7 --- /dev/null +++ b/tikz/dst-end/README.md @@ -0,0 +1,3 @@ +Compiled example +---------------- +![Example](dst-end.png) diff --git a/tikz/dst-end/dst-end.png b/tikz/dst-end/dst-end.png new file mode 100644 index 0000000..3301393 Binary files /dev/null and b/tikz/dst-end/dst-end.png differ diff --git a/tikz/dst-end/dst-end.tex b/tikz/dst-end/dst-end.tex new file mode 100644 index 0000000..98f9f6e --- /dev/null +++ b/tikz/dst-end/dst-end.tex @@ -0,0 +1,32 @@ +\documentclass[varwidth=false, border=2pt]{standalone} + +\usepackage{pgfplots} +\usepackage{tikz} + +\begin{document} +\begin{tikzpicture} + \begin{axis}[ + axis x line=middle, + axis y line=middle, + grid = major, + width=8cm, + height=8cm, + grid style={dashed, gray!30}, + xmin= 0, % start the diagram at this x-coordinate + xmax=24, % end the diagram at this x-coordinate + ymin= 0, % start the diagram at this y-coordinate + ymax= 24, % end the diagram at this y-coordinate + xlabel=UTC of 2018-10-28, + ylabel=Local time, + /pgfplots/xtick={0, 2, ..., 24}, % make steps of length 2 + /pgfplots/ytick={0, 2, ..., 24}, % make steps of length 2 + x label style={at={(axis description cs:0.5,0.1)},anchor=north}, + tick align=outside, + enlargelimits=false] + % plot the function + \addplot[domain=0:3, blue, ultra thick,samples=20] {x+2}; + \addplot[domain=3:23, blue, ultra thick,samples=20] {x+1}; + \addplot[domain=23:24, blue, ultra thick,samples=20] {x-23}; + \end{axis} +\end{tikzpicture} +\end{document} diff --git a/tikz/dst-start/Makefile b/tikz/dst-start/Makefile new file mode 100644 index 0000000..c584360 --- /dev/null +++ b/tikz/dst-start/Makefile @@ -0,0 +1,31 @@ +SOURCE = dst-start +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/dst-start/README.md b/tikz/dst-start/README.md new file mode 100644 index 0000000..58d05de --- /dev/null +++ b/tikz/dst-start/README.md @@ -0,0 +1,3 @@ +Compiled example +---------------- +![Example](dst-start.png) diff --git a/tikz/dst-start/dst-start.png b/tikz/dst-start/dst-start.png new file mode 100644 index 0000000..78eab6c Binary files /dev/null and b/tikz/dst-start/dst-start.png differ diff --git a/tikz/dst-start/dst-start.tex b/tikz/dst-start/dst-start.tex new file mode 100644 index 0000000..66db07d --- /dev/null +++ b/tikz/dst-start/dst-start.tex @@ -0,0 +1,32 @@ +\documentclass[varwidth=false, border=2pt]{standalone} + +\usepackage{pgfplots} +\usepackage{tikz} + +\begin{document} +\begin{tikzpicture} + \begin{axis}[ + axis x line=middle, + axis y line=middle, + grid = major, + width=8cm, + height=8cm, + grid style={dashed, gray!30}, + xmin= 0, % start the diagram at this x-coordinate + xmax=24, % end the diagram at this x-coordinate + ymin= 0, % start the diagram at this y-coordinate + ymax= 24, % end the diagram at this y-coordinate + xlabel=UTC of 2018-03-25, + ylabel=Local time, + /pgfplots/xtick={0, 2, ..., 24}, % make steps of length 2 + /pgfplots/ytick={0, 2, ..., 24}, % make steps of length 2 + x label style={at={(axis description cs:0.5,0.1)},anchor=north}, + tick align=outside, + enlargelimits=false] + % plot the function + \addplot[domain=0:1, blue, ultra thick,samples=20] {x+1}; + \addplot[domain=1:22, blue, ultra thick,samples=20] {x+2}; + \addplot[domain=22:24, blue, ultra thick,samples=20] {x-22}; + \end{axis} +\end{tikzpicture} +\end{document}