neighbourhood-topology.tex 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. \begin{tikzpicture}
  2. \begin{axis}[
  3. axis x line=middle,
  4. axis y line=middle,
  5. %width=9cm,
  6. %height=4.5cm,
  7. xmin=-1, % start the diagram at this x-coordinate
  8. xmax= 5, % end the diagram at this x-coordinate
  9. ymin=-1, % start the diagram at this y-coordinate
  10. ymax= 5, % end the diagram at this y-coordinate
  11. xlabel=$X_1$,
  12. ylabel=$X_2$,
  13. ticks=none,
  14. enlargelimits=true,
  15. after end axis/.code={
  16. \draw [decorate,decoration={brace,mirror,raise=15pt}] (axis cs:0,3.6) -- (axis cs:0,2.5) node [midway,left=20pt] {$U_2$};
  17. \draw [decorate,decoration={brace,mirror,raise=12pt}] (axis cs:1.5,0) -- (axis cs:2.5,0) node [midway,below=16pt] {$U_1$};
  18. }]
  19. \addplot[mark=none, orange, smooth cycle, thick, fill=orange!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)};
  20. \node[orange] at (axis cs:4,4) [anchor=south] {$U$};
  21. % Draw help lines
  22. \addplot[dashed] coordinates {(1.5,0) (1.5,3.6)};
  23. \addplot[dashed] coordinates {(2.5,0) (2.5,3.6)};
  24. \addplot[dashed] coordinates {(0,2.5) (2.5,2.5)};
  25. \addplot[dashed] coordinates {(0,3.6) (2.5,3.6)};
  26. % Draw solid square
  27. \addplot[mark=none, red, thick, fill=red!30] coordinates {(2.5,2.5) (2.5,3.6) (1.5,3.6) (1.5,2.5) (2.5,2.5)};
  28. % Draw x and annotation
  29. \node[blue] at (axis cs:2,3) [anchor=south west] {$x$};
  30. \addplot[mark=*, blue] coordinates {(2,3)};
  31. % Draw ticks of help lines
  32. \addplot[mark=none, red, thick] coordinates {(1.5, -0.1) (1.5,0.1)};
  33. \addplot[mark=none, red, thick] coordinates {(2.5, -0.1) (2.5,0.1)};
  34. \addplot[mark=none, red, thick] coordinates {(-0.1, 2.5) (0.1,2.5)};
  35. \addplot[mark=none, red, thick] coordinates {(-0.1, 3.6) (0.1,3.6)};
  36. % Draw axis text
  37. \node[blue] at (axis cs:0,3) [anchor=east] {$x_2$};
  38. \node[blue] at (axis cs:2,0) [anchor=north] {$x_1$};
  39. \end{axis}
  40. \end{tikzpicture}