LaTeX forum ⇒ Graphics, Figures & TablestikZ | Indicate further Vertices

Information and discussion about graphics, figures & tables in LaTeX documents.
RichardLang
Posts: 2
Joined: Wed Jan 30, 2013 2:28 pm

tikZ | Indicate further Vertices

Postby RichardLang » Wed Jan 30, 2013 2:58 pm

Hi,

I use tikZ to draw graphs. In the picture below, I'd like to indicate that the vertices v_1, v_2 and v have neighbours that are not shown in the picture. I was thinking about a little cone or something similar, but I've no idea how to implement that.
  1. \documentclass[11pt,a4paper]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage{tikz}
  4.  
  5. \begin{document}
  6. \begin{figure}[!ht]
  7. \centering
  8. \tikzstyle{vertex}=[circle,draw, minimum size=12pt,inner sep=0pt]
  9. \tikzstyle{edge}=[draw,-]
  10. \tikzstyle{weight}=[font=\small]
  11. \begin{tikzpicture}
  12. \foreach \pos/\name in {{(1,3)/v_1}, {(1,2)/v}, {(2,2)/w_2},{(0,2)/w_1},{(1,1)/v_2}, {(2,3)/v_3}}
  13. \node[vertex] (\name) at \pos {$\name$};
  14. \foreach \source/ \dest /\weight in {v_1/v/5, v_1/w_1/3,v_1/w_2/3,v/w_1/2, v/w_2/2, v_2/v/5 , v_2/w_1/3 , v_2/w_2/3, v/v_3/1 }
  15. \path[edge] (\source) -- node[weight] {} (\dest);
  16. \foreach \vertex in {}
  17. \path node[selected vertex] at (\vertex) {$\vertex$};
  18. \end{tikzpicture}
  19. \end{figure}
  20. \end{document}

It would be great if someone could help me out here or just post an example.


Thanks in advance
Richard

Link:
BBcode:
HTML:
Hide post links
Show post links

percusse
Posts: 3
Joined: Mon Nov 12, 2012 11:24 pm

Postby percusse » Sun Feb 10, 2013 4:17 pm

Where would you put those cones with respect to the nodes? You can also consider drawing dashed lines (a web-like structure) in the background to indicate that there is more to the graph than it is already being shown.

Link:
BBcode:
HTML:
Hide post links
Show post links

RichardLang
Posts: 2
Joined: Wed Jan 30, 2013 2:28 pm

Postby RichardLang » Mon Feb 11, 2013 9:33 pm

Thanks for the answer! I would like to produce something like in the picture of page 2 of this article:

http://www.nishizeki.ecei.tohoku.ac.jp/ ... J/J147.pdf

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 4 guests