Advertisement
Guest User

Untitled

a guest
Jul 17th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.57 KB | None | 0 0
  1. tikzset{vertex style/.style={
  2. draw=#1,
  3. thick,
  4. fill=#1!70,
  5. text=white,
  6. ellipse,
  7. minimum width=2cm,
  8. minimum height=0.75cm,
  9. font=small,
  10. outer sep=3pt, % the usage of this option will be clear later on
  11. },
  12. }
  13.  
  14. usetikzlibrary{shapes.geometric}
  15.  
  16. documentclass[dvipsnames,png,border=10pt,tikz]{standalone}
  17. usepackage{tikz}
  18. usetikzlibrary{shapes.geometric} % required for the ellipse shape
  19. tikzset{vertex style/.style={
  20. draw=#1,
  21. thick,
  22. fill=#1!70,
  23. text=white,
  24. ellipse,
  25. minimum width=2cm,
  26. minimum height=0.75cm,
  27. font=small,
  28. outer sep=3pt,
  29. },
  30. }
  31. begin{document}
  32. begin{tikzpicture}
  33. node[vertex style=Turquoise] (Rk) {Righteous Kill};
  34. end{tikzpicture}
  35. end{document}
  36.  
  37. node[options] (a) {text a} ... edge[options] node[options]{text conn} (b);
  38.  
  39. begin{tikzpicture}[node distance=2.75cm,>=stealth']
  40. node[vertex style=Turquoise] (Rk) {Righteous Kill};
  41.  
  42. node[vertex style=BurntOrange, above of=Rk,xshift=2em] (BD) {Bryan Dennehy}
  43. edge [<-,cyan!60!blue] node[text style,above]{starring} (Rk);
  44. end{tikzpicture}
  45.  
  46. tikzset{
  47. text style/.style={
  48. sloped, % the text will be parallel to the connection
  49. text=black,
  50. font=footnotesize,
  51. above
  52. }
  53. }
  54.  
  55. begin{tikzpicture}[node distance=2.75cm,>=stealth']
  56. node[vertex style=Turquoise] (Rk) {Righteous Kill};
  57.  
  58. node[vertex style=BurntOrange, above of=Rk,xshift=2em] (BD) {Bryan Dennehy}
  59. edge [<-,cyan!60!blue] node[text style]{starring} (Rk);
  60.  
  61. node[vertex style=BurntOrange, right=1.5cm of Rk,yshift=4ex] (AP) {Al Pacino}
  62. edge [<-,cyan!60!blue] node[text style]{starring} (Rk);
  63.  
  64. node[vertex style=red, below right of=Rk,xshift=2em] (JA) {John Avnet}
  65. edge [<-,cyan!60!blue] node[text style]{director} (Rk);
  66.  
  67. node[vertex style=BurntOrange, right=1.5cm of Rk,yshift=-4ex] (RN) {Robert De Niro}
  68. edge [<-,cyan!60!blue] node[text style]{starring} (Rk);
  69.  
  70. node[vertex style=MidnightBlue, above right of=Rk,xshift=2em] (Dr) {Drama}
  71. edge [<-,cyan!60!blue] node[text style]{genre} (Rk);
  72.  
  73. node[vertex style=Maroon, below of=Rk,xshift=-2em] (Skf) {Serial Killer Films}
  74. edge [<-,cyan!60!blue] node[text style]{subject} (Rk);
  75.  
  76. node[vertex style=Maroon, below right of=Skf] (Cf) {Crime Films}
  77. edge [<-,cyan!60!blue] node[text style]{broader} (Skf);
  78. end{tikzpicture}
  79.  
  80. begin{pgfonlayer}{background}
  81. draw[Maroon,fill=Maroon,dashed,fill opacity=0.1](Rk.north)
  82. to[closed,curve through={(Rk.north west).. (Rk.west) .. (Rk.south west)
  83. ..($(Rk.south west)!0.5!(Skf.north)$) .. (Skf.north west).. (Skf.west)
  84. .. (Skf.south west) .. ($(Skf.south)!0.75!(Cf.west)$) .. (Cf.west)
  85. .. (Cf.south west) .. (Cf.south) .. (Cf.south east) .. (Cf.east)
  86. .. ($(Cf.north east)!0.65!(Skf.south east)$) .. (Skf.east)
  87. .. (Skf.north east).. ($(Skf.north)!0.35!(Rk.south east)$)
  88. .. (Rk.south east) .. (Rk.east)..(Rk.north east)}](Rk.north);
  89. end{pgfonlayer}
  90.  
  91. documentclass[dvipsnames,png,border=10pt,tikz]{standalone}
  92. usepackage{tikz}
  93. usetikzlibrary{shapes.geometric} % required for the ellipse shape
  94. usetikzlibrary{arrows, backgrounds, calc, hobby, positioning}
  95.  
  96. % this avoides some problem with the hobby implementation
  97. % egreg's code from:
  98. % http://www.guitex.org/home/it/forum/5-tex-e-latex/83195-la-libreria-hobby-tikz-non-funziona-piu#83203
  99. ExplSyntaxOn
  100. cs_if_exist:NF prg_stepwise_function:nnnN { cs_gset_eq:NN prg_stepwise_function:nnnN int_step_function:nnnN }
  101. cs_if_exist:NF prg_stepwise_inline:nnnn { cs_gset_eq:NN prg_stepwise_inline:nnnn int_step_inline:nnnn }
  102. ExplSyntaxOff
  103.  
  104. tikzset{vertex style/.style={
  105. draw=#1,
  106. thick,
  107. fill=#1!70,
  108. text=white,
  109. ellipse,
  110. minimum width=2cm,
  111. minimum height=0.75cm,
  112. font=small,
  113. outer sep=3pt,
  114. },
  115. text style/.style={
  116. sloped,
  117. text=black,
  118. font=footnotesize,
  119. above
  120. }
  121. }
  122.  
  123. begin{document}
  124. begin{tikzpicture}[node distance=2.75cm,>=stealth']
  125. node[vertex style=Turquoise] (Rk) {Righteous Kill};
  126.  
  127. node[vertex style=BurntOrange, above of=Rk,xshift=2em] (BD) {Bryan Dennehy}
  128. edge [<-,cyan!60!blue] node[text style]{starring} (Rk);
  129.  
  130. node[vertex style=BurntOrange, right=1.5cm of Rk,yshift=4ex] (AP) {Al Pacino}
  131. edge [<-,cyan!60!blue] node[text style]{starring} (Rk);
  132.  
  133. node[vertex style=red, below right of=Rk,xshift=2em] (JA) {John Avnet}
  134. edge [<-,cyan!60!blue] node[text style]{director} (Rk);
  135.  
  136. node[vertex style=BurntOrange, right=1.5cm of Rk,yshift=-4ex] (RN) {Robert De Niro}
  137. edge [<-,cyan!60!blue] node[text style]{starring} (Rk);
  138.  
  139. node[vertex style=MidnightBlue, above right of=Rk,xshift=2em] (Dr) {Drama}
  140. edge [<-,cyan!60!blue] node[text style]{genre} (Rk);
  141.  
  142. node[vertex style=Maroon, below of=Rk,xshift=-2em] (Skf) {Serial Killer Films}
  143. edge [<-,cyan!60!blue] node[text style]{subject} (Rk);
  144.  
  145. node[vertex style=Maroon, below right of=Skf] (Cf) {Crime Films}
  146. edge [<-,cyan!60!blue] node[text style]{broader} (Skf);
  147.  
  148. begin{pgfonlayer}{background}
  149. draw[Maroon,fill=Maroon,dashed,fill opacity=0.1](Rk.north)
  150. to[closed,curve through={(Rk.north west).. (Rk.west) .. (Rk.south west)
  151. ..($(Rk.south west)!0.5!(Skf.north)$) .. (Skf.north west).. (Skf.west)
  152. .. (Skf.south west) .. ($(Skf.south)!0.75!(Cf.west)$) .. (Cf.west)
  153. .. (Cf.south west) .. (Cf.south) .. (Cf.south east) .. (Cf.east)
  154. .. ($(Cf.north east)!0.65!(Skf.south east)$) .. (Skf.east)
  155. .. (Skf.north east).. ($(Skf.north)!0.35!(Rk.south east)$)
  156. .. (Rk.south east) .. (Rk.east)..(Rk.north east)}](Rk.north);
  157. end{pgfonlayer}
  158.  
  159. end{tikzpicture}
  160. end{document}
  161.  
  162. begin{tikzpicture}[node distance=2.75cm,>=stealth']
  163. node[vertex style=Turquoise] (Rk) {Righteous Kill};
  164.  
  165. node[vertex style=BurntOrange, above of=Rk,xshift=2em] (BD) {Bryan Dennehy}
  166. edge [<-,cyan!60!blue] node[text style,above]{starring} (Rk);
  167. end{tikzpicture}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement