1

I am trying to create a Tikz node with some text that has the 'data storage' flowchart shape:

enter image description here

This is what I'm building on:

\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\tikzstyle{storage} = [rectangle, minimum width=3cm, minimum height=1cm, text width=3cm, text centered, draw=black]
\begin{tikzpicture}[node distance=2cm]
    \node (sto1) [storage] {Some text}
\end{tikzpicture}

I have been trying to get the data storage node shape, mainly referring to this question as well as this one, however I haven't succeeded in creating it.

  • Are you looking for \tikz\node[cylinder, aspect=.5, minimum height=5mm, cylinder uses custom fill, cylinder body fill=blue!30, draw] {}; ? – Kpym May 11 '18 at 14:28
  • @Kpym This seems to create a cylinder which has the fill that I want but still the borders of a cylinder. – hb20007 May 11 '18 at 14:46
3
\documentclass[tikz,border=3.14mm]{standalone}
\makeatletter % https://tex.stackexchange.com/a/241737/121799
\tikzset{pics/named scope code/.style={code={\tikz@fig@mustbenamed%
  \begin{scope}[local bounding box/.expanded=\tikz@fig@name]#1\end{scope}%
}}}
\makeatother
\tikzset{pics/.cd,
  pic memory/.style={named scope code={
  \filldraw[fill=blue!30!gray!50](0,0) arc(90:270:0.5 and 1) --++(4,0) arc(-90:-270:0.5 and 1) --cycle
 node[pos=.6,below={1cm},anchor=center] {#1};
  }}
}
\begin{document}
\begin{tikzpicture}
\pic (memory1) at (0,0) {pic memory=Test text};
\draw[thick,blue,-latex] (memory1.west) -- ++(-2,0);
\draw[thick,red,-latex] (memory1.north) -- ++(-1,2);
\end{tikzpicture}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.