diff --git a/tikz/xor-problem/Makefile b/tikz/xor-problem/Makefile new file mode 100644 index 0000000..f5ba64b --- /dev/null +++ b/tikz/xor-problem/Makefile @@ -0,0 +1,33 @@ +SOURCE = xor-problem +DELAY = 80 +DENSITY = 300 +WIDTH = 512 + +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-width=$(WIDTH) --export-plain-svg=$(SOURCE)1.svg + rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg + rm $(SOURCE)1.svg diff --git a/tikz/xor-problem/README.md b/tikz/xor-problem/README.md new file mode 100644 index 0000000..d874163 --- /dev/null +++ b/tikz/xor-problem/README.md @@ -0,0 +1,3 @@ +Compiled example +---------------- +![Example](topology-simplex-1.png) diff --git a/tikz/xor-problem/xor-problem.png b/tikz/xor-problem/xor-problem.png new file mode 100644 index 0000000..7755ad5 Binary files /dev/null and b/tikz/xor-problem/xor-problem.png differ diff --git a/tikz/xor-problem/xor-problem.tex b/tikz/xor-problem/xor-problem.tex new file mode 100644 index 0000000..8781fbf --- /dev/null +++ b/tikz/xor-problem/xor-problem.tex @@ -0,0 +1,35 @@ +\documentclass[varwidth=true, border=2pt]{standalone} + +\usepackage{pgfplots} +\usepackage{tikz} +\usepackage{tkz-fct} +\usetikzlibrary{shapes.misc} + +\begin{document} +\begin{tikzpicture} + \tikzstyle{point}=[thick,draw=black,cross out,inner sep=0pt,minimum width=4pt,minimum height=4pt] + \begin{axis}[ + legend pos=south west, + axis x line=middle, + axis y line=middle, + grid = major, + width=6cm, + height=6cm, + grid style={dashed, gray!30}, + xmin=0, % start the diagram at this x-coordinate + xmax=1, % end the diagram at this x-coordinate + ymin=0, % start the diagram at this y-coordinate + ymax=1, % end the diagram at this y-coordinate + xlabel=$x$, + ylabel=$y$, + tick align=outside, + minor tick num=-3, + enlargelimits=true] + % \addplot[domain=0:2.5, red, thick,samples=20] {-x+2.5}; + \node[point,label={[label distance=0cm,text=red]135:$0$},red] at (axis cs:1,0) {}; + \node[point,label={[label distance=0cm,text=red]-45:$0$},red] at (axis cs:0,1) {}; + \node[point,label={[label distance=0cm,text=blue]45:$1$},blue] at (axis cs:0,0) {}; + \node[point,label={[label distance=0cm,text=blue]-135:$1$},blue] at (axis cs:1,1) {}; + \end{axis} +\end{tikzpicture} +\end{document}