topology-jordan.tex 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. \documentclass[varwidth=true, border=2pt]{standalone}
  2. \usepackage{tikz}
  3. \usetikzlibrary{patterns,calc}
  4. \usepackage{pgfplots}
  5. \pgfplotsset{compat=1.7}
  6. \begin{document}
  7. % Code from Christian Feuersänger
  8. % http://tex.stackexchange.com/questions/54794/using-a-pgfplots-style-legend-in-a-plain-old-tikzpicture#54834
  9. % argument #1: any options
  10. \newenvironment{customlegend}[1][]{%
  11. \begingroup
  12. % inits/clears the lists (which might be populated from previous
  13. % axes):
  14. \csname pgfplots@init@cleared@structures\endcsname
  15. \pgfplotsset{#1}%
  16. }{%
  17. % draws the legend:
  18. \csname pgfplots@createlegend\endcsname
  19. \endgroup
  20. }%
  21. % makes \addlegendimage available (typically only available within an
  22. % axis environment):
  23. \def\addlegendimage{\csname pgfplots@addlegendimage\endcsname}
  24. %%--------------------------------
  25. % definition to insert numbers
  26. \pgfkeys{/pgfplots/number in legend/.style={%
  27. /pgfplots/legend image code/.code={%
  28. \node at (0.295,-0.0225){#1};
  29. },%
  30. },
  31. }
  32. \begin{tikzpicture}
  33. \draw[draw=white,pattern=north west lines, pattern color=blue] (-1.5,-1.5) rectangle (1.5,1.5);
  34. \draw[fill=white] (0cm,0cm) circle(1cm);
  35. \draw[fill=white,thick,pattern=dots, pattern color=red] (0cm,0cm) circle(1cm);
  36. \begin{customlegend}[
  37. legend entries={ % <= in the following there are the entries
  38. au{\ss}en,
  39. innen,
  40. Jordankurve
  41. },
  42. legend style={at={(4.5,1.5)},font=\footnotesize}] % <= to define position and font legend
  43. % the following are the "images" and numbers in the legend
  44. \addlegendimage{area legend,pattern=north west lines, pattern color=blue,draw=white}
  45. \addlegendimage{area legend,pattern=dots, pattern color=red,draw=white}
  46. \addlegendimage{thick}
  47. \end{customlegend}
  48. \end{tikzpicture}
  49. \end{document}