von esdd » Sa 11. Jun 2016, 19:47
Dann müssen die Linien anschließend noch gezeichnet werden:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix,calc}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{tikzpicture}[
dot/.style={fill=#1,circle,minimum size=4ex,anchor=center},
dot/.default={black},
]
\matrix[
matrix of nodes,
row sep=.6666em,
column sep=.6666em,
draw
](m){
|[dot=blue!20]| ? & |[dot=green]| & |[dot=green]| \\
|[dot=green]| & |[dot=blue!20]| ? & |[dot=green]| \\
|[dot=red]| & |[dot=yellow]| & |[dot=green]| \\
};
\foreach[count=\i] \j in {2,3}{
\draw($(m-1-\i|-m.north)!.5!(m-1-\j|-m.north)$)coordinate(h)--(h|-m.south);
\draw($(m-\i-1-|m.west)!.5!(m-\j-1-|m.west)$)coordinate(h)--(h-|m.east);
}
\foreach[count=\r] \text in{
Text A,
längerer Text B,
Text C
}\node[anchor=east]at(m-\r-1.west-|m.west){\text};
\foreach[count=\c] \text in{
foobar test,
etwas anderes,
lipsum swääg
}\node[anchor=north east, rotate=45]at(m-1-\c.south|-m.south){\text};
\end{tikzpicture}
\end{document}
oder
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix,calc}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{tikzpicture}[
dot/.style={fill=#1,circle,minimum size=4ex,anchor=center},
dot/.default={black},
rbu/.style={dot=blue!20},
rbl/.style={dot=green},
rbm/.style={dot=yellow},
rbh/.style={dot=red!50},
]
\matrix[
matrix of nodes,
nodes in empty cells,
nodes=rbl,
row sep=.6666em,
column sep=.6666em,
draw
](m){
|[rbu]|?& &\\
&|[rbu]|?&\\
|[rbh] |&|[rbm]| &\\
};
\foreach[count=\i] \j in {2,3}{
\draw($(m-1-\i|-m.north)!.5!(m-1-\j|-m.north)$)coordinate(h)--(h|-m.south);
\draw($(m-\i-1-|m.west)!.5!(m-\j-1-|m.west)$)coordinate(h)--(h-|m.east);
}
\foreach[count=\r] \text in{
Text A,
längerer Text B,
Text C
}\node[anchor=east]at(m-\r-1.west-|m.west){\text};
\foreach[count=\c] \text in{
foobar test,
etwas anderes,
lipsum swääg
}\node[anchor=north east, rotate=45]at(m-1-\c.south|-m.south){\text};
\end{tikzpicture}
\end{document}
Gruß
Elke
Dann müssen die Linien anschließend noch gezeichnet werden:
[code]\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix,calc}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{tikzpicture}[
dot/.style={fill=#1,circle,minimum size=4ex,anchor=center},
dot/.default={black},
]
\matrix[
matrix of nodes,
row sep=.6666em,
column sep=.6666em,
draw
](m){
|[dot=blue!20]| ? & |[dot=green]| & |[dot=green]| \\
|[dot=green]| & |[dot=blue!20]| ? & |[dot=green]| \\
|[dot=red]| & |[dot=yellow]| & |[dot=green]| \\
};
\foreach[count=\i] \j in {2,3}{
\draw($(m-1-\i|-m.north)!.5!(m-1-\j|-m.north)$)coordinate(h)--(h|-m.south);
\draw($(m-\i-1-|m.west)!.5!(m-\j-1-|m.west)$)coordinate(h)--(h-|m.east);
}
\foreach[count=\r] \text in{
Text A,
längerer Text B,
Text C
}\node[anchor=east]at(m-\r-1.west-|m.west){\text};
\foreach[count=\c] \text in{
foobar test,
etwas anderes,
lipsum swääg
}\node[anchor=north east, rotate=45]at(m-1-\c.south|-m.south){\text};
\end{tikzpicture}
\end{document}[/code]
oder
[code]\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix,calc}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{tikzpicture}[
dot/.style={fill=#1,circle,minimum size=4ex,anchor=center},
dot/.default={black},
rbu/.style={dot=blue!20},
rbl/.style={dot=green},
rbm/.style={dot=yellow},
rbh/.style={dot=red!50},
]
\matrix[
matrix of nodes,
nodes in empty cells,
nodes=rbl,
row sep=.6666em,
column sep=.6666em,
draw
](m){
|[rbu]|?& &\\
&|[rbu]|?&\\
|[rbh] |&|[rbm]| &\\
};
\foreach[count=\i] \j in {2,3}{
\draw($(m-1-\i|-m.north)!.5!(m-1-\j|-m.north)$)coordinate(h)--(h|-m.south);
\draw($(m-\i-1-|m.west)!.5!(m-\j-1-|m.west)$)coordinate(h)--(h-|m.east);
}
\foreach[count=\r] \text in{
Text A,
längerer Text B,
Text C
}\node[anchor=east]at(m-\r-1.west-|m.west){\text};
\foreach[count=\c] \text in{
foobar test,
etwas anderes,
lipsum swääg
}\node[anchor=north east, rotate=45]at(m-1-\c.south|-m.south){\text};
\end{tikzpicture}
\end{document}[/code]
Gruß
Elke