texture.tex 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. \documentclass[varwidth=true, border=2pt]{standalone}
  2. \usepackage{pgfplots}
  3. \usepackage{tikz}
  4. \usepackage{nicefrac}
  5. \begin{document}
  6. \begin{tikzpicture}
  7. \begin{axis}[
  8. legend pos=south west,
  9. axis x line=middle,
  10. axis y line=middle,
  11. grid = major,
  12. %width=9cm,
  13. %height=4.5cm,
  14. grid style={dashed, gray!30},
  15. xmin=-1.25, % start the diagram at this x-coordinate
  16. xmax= 1.25, % end the diagram at this x-coordinate
  17. ymin=-0.75, % start the diagram at this y-coordinate
  18. ymax= 1.75, % end the diagram at this y-coordinate
  19. axis background/.style={fill=white},
  20. xlabel=$s$,
  21. ylabel=$t$,
  22. %xticklabels={-2,-1.6,...,7},
  23. %yticklabels={-8,-7,...,8},
  24. tick align=outside,
  25. minor tick num=-3,
  26. enlargelimits=true,
  27. tension=0.08]
  28. \draw[fill=black!25] (axis cs:0.0,-.7) rectangle (axis cs:0.5,0.5) node[pos=.5] {C};
  29. \draw[fill=white] (axis cs:0.5,-.7) rectangle (axis cs:1.0,0.5) node[pos=.5] {D};
  30. \draw[fill=white] (axis cs:0.0,0.5) rectangle (axis cs:0.5,1.7) node[pos=.5] {A};
  31. \draw[fill=black!25] (axis cs:0.5,0.5) rectangle (axis cs:1.0,1.7) node[pos=.5] {B};
  32. \draw[fill=black!25] (axis cs:1.0,-.7) rectangle (axis cs:1.5,0.5) node[pos=.5] {C};
  33. \draw[fill=white] (axis cs:1.0,0.5) rectangle (axis cs:1.5,1.7) node[pos=.5] {A};
  34. \draw[fill=black!25] (axis cs:-0.5,0.5) rectangle (axis cs:0.0,1.7) node[pos=.5] {B};
  35. \draw[fill=white] (axis cs:-0.5,-.7) rectangle (axis cs:0.0,0.5) node[pos=.5] {D};
  36. \draw[fill=black!25] (axis cs:-0.5,-.7) rectangle (axis cs:-1.0,0.5) node[pos=.5] {C};
  37. \draw[fill=white] (axis cs:-0.5,0.5) rectangle (axis cs:-1.0,1.7) node[pos=.5] {A};
  38. \draw[fill=black!25] (axis cs:-1.5,0.5) rectangle (axis cs:-1.0,1.7) node[pos=.5] {B};
  39. \draw[fill=white] (axis cs:-1.5,-.7) rectangle (axis cs:-1.0,0.5) node[pos=.5] {D};
  40. \end{axis}
  41. \begin{axis}[
  42. axis x line=middle,
  43. axis y line=middle,
  44. grid = major,
  45. grid style={dashed, gray!30},
  46. xmin=-1.25, % start the diagram at this x-coordinate
  47. xmax= 1.25, % end the diagram at this x-coordinate
  48. ymin=-0.75, % start the diagram at this y-coordinate
  49. ymax= 1.75, % end the diagram at this y-coordinate
  50. xlabel=$s$,
  51. ylabel=$t$,
  52. %xticklabels={-2,-1.6,...,7},
  53. %yticklabels={-8,-7,...,8},
  54. tick align=outside,
  55. minor tick num=-3,
  56. enlargelimits=true,
  57. tension=0.08]
  58. \draw[red,thick] (axis cs:-0.5,-.5) rectangle (axis cs:1,1.5) node[pos=.5] {};
  59. \node[label={180:{1}},circle,fill,inner sep=2pt] at (axis cs:-0.5,-0.5) {};
  60. \node[label={180:{2}},circle,fill,inner sep=2pt] at (axis cs:1,-0.5) {};
  61. \node[label={180:{3}},circle,fill,inner sep=2pt] at (axis cs:1,1.5) {};
  62. \node[label={180:{4}},circle,fill,inner sep=2pt] at (axis cs:-0.5,1.5) {};
  63. \end{axis}
  64. \end{tikzpicture}
  65. \end{document}