Graphics, Figures & TablesNaming a Graph

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

Naming a Graph

Post by uyysidmc »

\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.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
TikZ book
User avatar
Stefan Kottwitz
Site Admin
Posts: 10311
Joined: Mon Mar 10, 2008 9:44 pm

Naming a Graph

Post by Stefan Kottwitz »

Hi!

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

Code: Select all

\documentclass[border=16pt]{standalone}
\usepackage{tikz}
\begin{document} 
\begin{tikzpicture}[acteur/.style={circle, fill=black,thick,
  inner sep=4pt, minimum size=0.2cm}]
  \node (A) at (5,12) [acteur][label=right:{(0,0,0})]{};
  \node (B) at (8,11) [acteur][label=right:{(0,0,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}
\end{document}
Stefan
LaTeX.org admin
uyysidmc
Posts: 3
Joined: Thu Sep 06, 2018 12:26 pm

Naming a Graph (Please help me on this T_T need tomorrow.)

Post by uyysidmc »

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