neighbourhood-topology-open.tex 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. \documentclass[varwidth=true, border=2pt]{standalone}
  2. \usepackage{tikz}
  3. \usetikzlibrary{patterns}
  4. \usepackage{pgfplots}
  5. \pgfplotsset{compat=1.7}
  6. \begin{document}
  7. \begin{tikzpicture}
  8. \begin{axis}[
  9. axis x line=middle,
  10. axis y line=middle,
  11. %width=9cm,
  12. %height=4.5cm,
  13. xmin=-1, % start the diagram at this x-coordinate
  14. xmax= 5, % end the diagram at this x-coordinate
  15. ymin=-1, % start the diagram at this y-coordinate
  16. ymax= 5, % end the diagram at this y-coordinate
  17. xlabel=$Y$,
  18. ylabel=$X$,
  19. ticks=none,
  20. enlargelimits=true,
  21. after end axis/.code={
  22. \draw [decorate,decoration={brace,mirror,raise=15pt}, orange] (axis cs:0,3.6) -- (axis cs:0,2.5) node [midway,left=20pt,orange] {$V_{x,y}$};
  23. \draw [decorate,decoration={brace,mirror,raise=12pt}, green] (axis cs:1.5,0) -- (axis cs:2.5,0) node [midway,below=16pt,green] {$U_{x,y}$};
  24. }]
  25. \addplot[mark=none, red, smooth cycle, thick, fill=red!30] coordinates {(1,1) (2,0.5) (3,1.5) (3,2) (3.5,3) (3.2, 5) (2.2, 4.7) (1.5, 4.2) (1.1, 3.9) (0.9, 2.5)};
  26. \node[red] at (axis cs:4,4) [anchor=south] {$W_i$};
  27. % Draw help lines
  28. %\addplot[dashed] coordinates {(1.5,0) (1.5,3.6)};
  29. %\addplot[dashed] coordinates {(2.5,0) (2.5,3.6)};
  30. %\addplot[dashed] coordinates {(0,2.5) (2.5,2.5)};
  31. %\addplot[dashed] coordinates {(0,3.6) (2.5,3.6)};
  32. % Draw solid square
  33. \addplot[mark=none, orange, thick] coordinates {(2.5,2.5) (2.5,3.6)};
  34. \addplot[mark=none, green, thick] coordinates {(2.5,3.6) (1.5,3.6)};
  35. \addplot[mark=none, orange, thick] coordinates {(1.5,3.6) (1.5,2.5)};
  36. \addplot[mark=none, green, thick] coordinates {(1.5,2.5) (2.5,2.5)};
  37. \addplot[mark=none, orange, thick] coordinates {(3.0,1.5) (3.0,2.6)};
  38. \addplot[mark=none, green, thick] coordinates {(3.0,2.6) (1.1,2.6)};
  39. \addplot[mark=none, orange, thick] coordinates {(1.1,1.5) (1.1,2.6)};
  40. \addplot[mark=none, green, thick] coordinates {(1.1,1.5) (3.0,1.5)};
  41. \addplot[mark=none, orange, thick] coordinates {(3.0,1.5) (3.0,2.6)};
  42. \addplot[mark=none, green, thick] coordinates {(3.0,2.6) (1.1,2.6)};
  43. \addplot[mark=none, orange, thick] coordinates {(1.1,1.5) (1.1,2.6)};
  44. \addplot[mark=none, green, thick] coordinates {(1.1,1.5) (3.0,1.5)};
  45. \addplot[mark=none, blue, thick, dashed] coordinates {((1.8,0) (1.8,5)};
  46. \addplot[mark=none, blue, thick, dashed] coordinates {((2.2,0) (2.2,5)};
  47. % Draw x and annotation
  48. \node at (axis cs:2,3) [anchor=-90] {$x$};
  49. \addplot[mark=*] coordinates {(2,3)};
  50. % Draw ticks of help lines
  51. \addplot[mark=none, green, thick] coordinates {(1.5, -0.1) (1.5,0.1)};
  52. \addplot[mark=none, green, thick] coordinates {(2.5, -0.1) (2.5,0.1)};
  53. \addplot[mark=none, green, thick] coordinates {(1.5, 0) (2.5,0)};
  54. \addplot[mark=none, orange, thick] coordinates {(-0.1, 2.5) (0.1,2.5)};
  55. \addplot[mark=none, orange, thick] coordinates {(-0.1, 3.6) (0.1,3.6)};
  56. \addplot[mark=none, orange, thick] coordinates {(0, 2.5) (0,3.6)};
  57. % Draw axis text
  58. \node at (axis cs:0,3) [anchor=east] {$y$};
  59. \node at (axis cs:2,0) [anchor=north] {$x$};
  60. \end{axis}
  61. \end{tikzpicture}
  62. \end{document}