open-square.tex 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. \documentclass[varwidth=true, border=2pt]{standalone}
  2. \usepackage{tikz}
  3. \usepackage{pgfplots}
  4. \usepackage{amsmath,amssymb}
  5. \begin{document}
  6. \begin{tikzpicture}
  7. \begin{axis}[
  8. axis x line=middle,
  9. axis y line=middle,
  10. xmin=-1.5, % start the diagram at this x-coordinate
  11. xmax= 1.5, % end the diagram at this x-coordinate
  12. ymin=-1.5, % start the diagram at this y-coordinate
  13. ymax= 1.5, % end the diagram at this y-coordinate
  14. ticks=none,
  15. enlargelimits=true,
  16. after end axis/.code={
  17. \draw [decorate,decoration={brace,mirror,raise=2pt}] (axis cs:0,1) -- (axis cs:-1,1) node [midway,above=5pt] {$r$};
  18. \draw [decorate,decoration={brace,mirror,raise=2pt}] (axis cs:1,1) -- (axis cs:0,1) node [midway,above=5pt] {$r$};
  19. \draw [decorate,decoration={brace,mirror,raise=2pt}] (axis cs:1,0) -- (axis cs:1,1) node [midway,right=5pt] {$r$};
  20. \draw [decorate,decoration={brace,mirror,raise=2pt}] (axis cs:1,-1) -- (axis cs:1,0) node [midway,right=5pt] {$r$};
  21. }]
  22. % Draw solid square
  23. \addplot[mark=none, thick] coordinates {(-1,-1) (1,-1) (1,1) (-1,1) (-1,-1)};
  24. \addplot[mark=*] coordinates {(0,0)};
  25. % Draw axis text
  26. \node at (axis cs:-1,0.5) [anchor=east] {$\mathfrak{B}_r(0) = $};
  27. \end{axis}
  28. \end{tikzpicture}
  29. \end{document}