Guest User

Untitled

a guest
Mar 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. documentclass{article}
  2. usepackage{tikz}
  3. usetikzlibrary{arrows,positioning,shapes,fit,calc}
  4. pgfdeclarelayer{background}
  5. pgfsetlayers{background,main}
  6. begin{document}
  7. begin{tikzpicture}[
  8. every node/.style={on grid},
  9. setA/.style={fill=black, circle, inner sep=1.2pt},
  10. setC/.style={fill=red, rectangle,inner sep=2pt},
  11. every fit/.style={draw, fill=white,rectangle,rounded corners=5pt, text width=70pt},>=latex]
  12.  
  13. % set A
  14. node [setA, below = of a,label=left:Initiator] (a) {};
  15. node[above=of USA,anchor=south] {};
  16.  
  17. % set B
  18. node[inner sep=0pt,right=3cm of a] (x) {Person x};
  19. node[below = of x] (y) {Person y};
  20. node[inner sep=0pt,below = of y] (z) {Person z};
  21. node[above=of x,anchor=south] {$B$};
  22.  
  23. % set C
  24. node[setC,label=right:$m$,right = 3cm of x] (m) {Task a: xxxxxx};
  25. node[setC,label=right:$n$,below = of m] (n) {Task b: yyyyy};
  26. node[setC,label=right:$p$,below = of n] (p) {Task c: zzzzz};
  27. node[above=of m,anchor=south] {$C$};
  28.  
  29. % the arrows
  30. draw[->,shorten >= 3pt] (a) -- node[label=above:$f$] {} (x);
  31. draw[->,shorten >= 3pt] (b) -- node[label=above:$f$] {} (x);
  32. draw[->] (c) -- node[label=above:$g$] {} (y);
  33. draw[->,shorten <= 3pt] (x) -- node[label=above:$h$] {} (m);
  34. draw[->] (n) -- node[label=above:$u$] {} (y);
  35.  
  36. % the boxes around the sets
  37. begin{pgfonlayer}{background}
  38. node[fit= (a) (c) ] {};
  39. node[fit= (x) (z) ] {};
  40. node[fit= (m) (p)] {};
  41. end{pgfonlayer}
  42. end{tikzpicture}
  43. end{document}
Add Comment
Please, Sign In to add comment