LaTeX forum ⇒ Graphics, Figures & TablesNaming a Graph Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
uyysidmc
Posts: 3
Joined: Thu Sep 06, 2018 12:26 pm

Naming a Graph

Postby uyysidmc » Wed Sep 12, 2018 6:40 pm

\begin{tikzpicture}
[acteur/.style={circle, fill=black,thick, inner sep=4pt, minimum size=0.2cm}]
\node (A) at (5,12) [acteur][label=right:0]{};
\node (B) at (8,11) [acteur][label=right:1]{};
\node (C) at (9,9) [acteur][label=left:2]{};
\node (D) at (8,7) [acteur][label=right:3]{};
\node (E) at (5,6) [acteur][label=below:4]{};
\node (F) at (2,7) [acteur][label=right:5]{};
\node (G) at (1,9) [acteur][label=left:6]{};
\node (H) at (2,11) [acteur][label=right:7]{};
\path (A) edge [loop above, thick] node {} (0);
\path (B) edge [loop above, thick] node {} (1);
\path (C) edge [loop above, thick] node {} (2);
\path (D) edge [loop above, thick] node {} (3);
\path (E) edge [loop above, thick] node {} (4);
\path (F) edge [loop above, thick] node {} (5);
\path (G) edge [loop above, thick] node {} (6);
\path (H) edge [loop above, thick] node {} (7);
\end{tikzpicture}

It occur an error when i change label 0 to label (0,0,0), label 1 to label (0,0,1) ... and so on
like this
\node (A) at (5,12) [acteur][label=right:(0,0,0)]{};
\node (B) at (8,11) [acteur][label=right:(0,0,1)]{};
... and so on

i need to change the label 0 to label (0,0,0), label 1 to label (0,0,1) ... and so on
Last edited by uyysidmc on Thu Sep 13, 2018 6:17 am, edited 1 time in total.

User avatar
Stefan Kottwitz
Site Admin
Posts: 9105
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Wed Sep 12, 2018 7:24 pm

Hi!

You can "protect" the label name by grouping in additional curly braces:

  1. \documentclass[border=16pt]{standalone}
  2. \usepackage{tikz}
  3. \begin{document}
  4. \begin{tikzpicture}[acteur/.style={circle, fill=black,thick,
  5. inner sep=4pt, minimum size=0.2cm}]
  6. \node (A) at (5,12) [acteur][label=right:{(0,0,0})]{};
  7. \node (B) at (8,11) [acteur][label=right:{(0,0,1)}]{};
  8. \node (C) at (9,9) [acteur][label=left:2]{};
  9. \node (D) at (8,7) [acteur][label=right:3]{};
  10. \node (E) at (5,6) [acteur][label=below:4]{};
  11. \node (F) at (2,7) [acteur][label=right:5]{};
  12. \node (G) at (1,9) [acteur][label=left:6]{};
  13. \node (H) at (2,11) [acteur][label=right:7]{};
  14. \path (A) edge [loop above, thick] node {} (0);
  15. \path (B) edge [loop above, thick] node {} (1);
  16. \path (C) edge [loop above, thick] node {} (2);
  17. \path (D) edge [loop above, thick] node {} (3);
  18. \path (E) edge [loop above, thick] node {} (4);
  19. \path (F) edge [loop above, thick] node {} (5);
  20. \path (G) edge [loop above, thick] node {} (6);
  21. \path (H) edge [loop above, thick] node {} (7);
  22. \end{tikzpicture}
  23. \end{document}


Stefan
Site admin

uyysidmc
Posts: 3
Joined: Thu Sep 06, 2018 12:26 pm

Postby uyysidmc » Thu Sep 13, 2018 6:17 am

Thank you so much sir Stefan. You help me so much ! :) :)


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 12 guests