[Tex/LaTex] Weird behavior of cylinder shape in TikZ

shapestikz-pgf

I am trying to draw a cylinder to represent a database in a diagram of mine. I have written this code, inside a much bigger document

\documentclass{article}
\usepackage{tikz}

\usetikzlibrary{shapes,shapes.geometric}

\begin{document}
\begin{tikzpicture}[node distance=5cm]
            \node (db1) [cylinder,
                         draw=black,
                         fill=blue!30,
                         aspect=0.8,
                         minimum width=2cm,
                         minimum height=1.5cm,
                         shape border rotate=90] {SOME TEXT};
            \node (db2) [cylinder,
                         draw=black,
                         fill=blue!30,
                         aspect=0.8,
                         minimum width=2cm,
                         minimum height=1.5cm,
                         shape border rotate=90,
                         right of=db1] {};
\end{tikzpicture}
\end{document}

However, the addition of text seems to break the aspect ratio. The output I get is this

weird behavior of cylinder shapes

Did I do something wrong or is this the expected behavior? I needed the cylinder like the second image, but having some text inside.

Best Answer

Try a lower value for aspect. Here it is with value of 0.25. The closer it's to 1, the more like yours. If you tried 0.10 it would almost be a rectangular shape.

Output

enter image description here

Code

\documentclass{article}
\usepackage{tikz}

\usetikzlibrary{shapes,shapes.geometric}

\begin{document}
\begin{tikzpicture}[node distance=5cm]

    \node (db1) [cylinder, 
        fill=blue!30,
        shape border rotate=90, 
        draw,
        minimum height=1.5cm,
        minimum width=2cm,
        shape aspect=.25,] {Some text};

\end{tikzpicture}
\end{document}