Search found 2 matches

by Howard87
Thu Mar 06, 2014 5:48 pm
Forum: Graphics, Figures & Tables
Topic: Creating labeled (a, b, c, …) nodes with TikZ and foreach
Replies: 1
Views: 7656

Creating labeled (a, b, c, …) nodes with TikZ and foreach

Hm…

I now seem to having found a way to do it:

\def \n {5}
\foreach \x/\y in {1/a,2/b,3/c,4/d,5/e} {
\node[mynodestyle] (\y) at ({360/\n * (\x - 1)}:3) {$\y$};
}


At least I don't have to worry about node positioning any more.
by Howard87
Thu Mar 06, 2014 3:49 pm
Forum: Graphics, Figures & Tables
Topic: Creating labeled (a, b, c, …) nodes with TikZ and foreach
Replies: 1
Views: 7656

Creating labeled (a, b, c, …) nodes with TikZ and foreach

Hello everybody,

I'm trying to create a graph using TikZ with a foreach loop. I'd like to label the nodes with characters, but I'm unable to do so.

\def \n {5}
\foreach \s in {1,...,\n} {
\node[mynodestyle] (\s) at ({360/\n * (\s - 1)}:3) {$\s$};
}

(I've been inspired by http://www.texample ...