标签在盒子内的位置

标签在盒子内的位置

想要将标签一(见附图)放入更大的盒子内。请提供建议。

\documentclass[tikz, margin=3mm]{standalone}
\usepackage{epstopdf}
\usepackage{graphicx}
\usepackage{subfig}
\usetikzlibrary{arrows,
calc,
fit,
positioning,
shapes.geometric}

\tikzset{
rrbox/.style={%rounded red box,
rectangle,
draw, rounded corners, thick, fill=red!20,
minimum height=8mm, minimum width=24mm,
text width =\pgfkeysvalueof{/pgf/minimum width}-2*\pgfkeysvalueof{/pgf/inner 
xsep},
align=center
},
sum/.style={% summation
circle,
draw=black, minimum size=8mm,
append after command={\pgfextra{\let\LN\tikzlastnode
        \draw[thick,shorten >=1mm, shorten <=1mm, -]
        (\LN.north) edge (\LN.south)
        (\LN.west)   to  (\LN.east);
        %        \draw[blue] (\LN.center)  circle (1.414*4 mm);
    }},% end of nappend after command
    node contents={}
},
disk/.style={% cylinder
    cylinder, shape border rotate=90,
    draw, fill=red!20,
    aspect=0.25,
    minimum height=12mm, minimum width=54mm,
    align=center
},
container/.style={
    rectangle,
    draw, rounded corners,
    inner sep=4mm, yshift=2mm,
    node contents={}
},
line/.style={
    draw, thick, dashed, -latex',
},
}% end of tikzset

\begin{document}    
    \begin{tikzpicture}[
    node distance=8mm and 4mm,
    ]
    \node (sum) [sum]; % sumation
    \node (a11) [rrbox, above left=4mm and 18mm of sum.west] {First \\Box};
    \node (a12) [rrbox, left =of a11] {Second \\ Box};
    \node (a21) [rrbox, below=of a11] {Third\\ Box};
    \node (a22) [rrbox, below=of a12] {Fourth \\ Box};
    \node (container1) [container, fit=(a11) (a22),
    label={[anchor=north]Label One}];
    \end{tikzpicture}       
\end{document}

在此处输入图片描述

相关内容