xor-problem.tex 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. \documentclass[varwidth=true, border=2pt]{standalone}
  2. \usepackage{pgfplots}
  3. \usepackage{tikz}
  4. \usepackage{tkz-fct}
  5. \usetikzlibrary{shapes.misc}
  6. \begin{document}
  7. \begin{tikzpicture}
  8. \tikzstyle{point}=[thick,draw=black,cross out,inner sep=0pt,minimum width=4pt,minimum height=4pt]
  9. \begin{axis}[
  10. legend pos=south west,
  11. axis x line=middle,
  12. axis y line=middle,
  13. grid = major,
  14. width=6cm,
  15. height=6cm,
  16. grid style={dashed, gray!30},
  17. xmin=0, % start the diagram at this x-coordinate
  18. xmax=1, % end the diagram at this x-coordinate
  19. ymin=0, % start the diagram at this y-coordinate
  20. ymax=1, % end the diagram at this y-coordinate
  21. xlabel=$x$,
  22. ylabel=$y$,
  23. tick align=outside,
  24. minor tick num=-3,
  25. enlargelimits=true]
  26. % \addplot[domain=0:2.5, red, thick,samples=20] {-x+2.5};
  27. \node[point,label={[label distance=0cm,text=red]135:$0$},red] at (axis cs:1,0) {};
  28. \node[point,label={[label distance=0cm,text=red]-45:$0$},red] at (axis cs:0,1) {};
  29. \node[point,label={[label distance=0cm,text=blue]45:$1$},blue] at (axis cs:0,0) {};
  30. \node[point,label={[label distance=0cm,text=blue]-135:$1$},blue] at (axis cs:1,1) {};
  31. \end{axis}
  32. \end{tikzpicture}
  33. \end{document}