I'm trying to change the node style so a node looks like a cylinder with a variable height.
currently i'm using this code
\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{automata,positioning,arrows,matrix,backgrounds,calc}
\usetikzlibrary{decorations.text}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{shapes.geometric}
\tikzset{
node_standard/.style = {
->,>=stealth',shorten >=1pt,node distance=2.5cm,auto,thick,
main node/.style={
circle,
fill=gray!25,
draw,
font=\sffamily\Large\bfseries}
,
black node/.style={
circle,
fill=black,
text=white,
draw,
font=\sffamily\Large\bfseries}
,
cylinder node0/.style={
ellipse,
draw=black,
thick,
aspect=0.7,
minimum height=0.4cm,
minimum width=0.8cm,
shape border rotate=90,
fill=gray!15}
,
cylinder node1/.style={
cylinder,
draw=black,
thick,
aspect=0.7,
minimum height=0.8cm,
minimum width=0.8cm,
shape border rotate=90,
cylinder uses custom fill,
cylinder body fill=gray!15,
cylinder end fill=gray!25}
,
cylinder node2/.style={
cylinder,
draw=black,
thick,
aspect=0.7,
minimum height=1.2cm,
minimum width=0.8cm,
shape border rotate=90,
cylinder uses custom fill,
cylinder body fill=gray!15,
cylinder end fill=gray!25}
,
cylinder node3/.style={
cylinder,
draw=black,
thick,
aspect=0.7,
minimum height=1.6cm,
minimum width=0.8cm,
shape border rotate=90,
cylinder uses custom fill,
cylinder body fill=gray!15,
cylinder end fill=gray!25}
}
}
\tikzset{
path_standard/.style = {
%anchor=south,
every node/.style={font=\sffamily\small}
}
}
\begin{document}
\begin{center}
\begin{tikzpicture} [node_standard, node distance=2cm]%
\node[cylinder node3] (1) {$s$};
\node[cylinder node2] (2) at (2cm,1cm) {$v$};
\node[cylinder node0] (3) at (1.6cm,-1cm) {$u$};
\node[cylinder node1] (4) [below right of=2] {$t$};
\path[path_standard]
(2) edge [dashed] node {} (1)
(2) edge node {} (4)
(3) edge [dashed] node {} (1)
edge node {} (2)
(4) edge [dashed] node {} (3);
\end{tikzpicture}
\ \\
\ \\
ole ole ole
\end{center}
\end{document}
and i intend something like in this picture:
so, as i said before, the nodes should look like a cylinder with an variable x to change their height. any advice how to implement this? 😉
Best Answer
Maybe this gives you a start: