Thanks to input from @HKumar here's a fix that uses two xshift
commands - one xshift
for each of the centres of the nodes which are joined by the brace.
It still would be nice to know why one xshift
doesn't move the whole brace as experimentation with the first xshift
value in the \draw [decorate,decoration=
below seems to have no effect.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calc}
\begin{document}
\begin{tikzpicture}[scale=1]
\draw[thick] (-1,0) rectangle +(6,7.5);
\filldraw[thick, top color=white,bottom color=red!50!] (0.5,0) rectangle node{$N_S$} +(1.3,0.5);
\filldraw[thick, top color=white,bottom color=red!50!] (2.2,0) rectangle node{$N_L$} +(1.3,0.65);
\filldraw[top color=white,bottom color=blue!50!] (0.5,0.5) rectangle node{$P_{1}$} +(1.3,0.5);
\filldraw[top color=white,bottom color=blue!50!] (2.2,0.65) rectangle node{$P_{2}$} +(1.3,1.0);
\filldraw[top color=white,bottom color=blue!50!] (0.5,1.0) rectangle node{$P_{3}$} +(1.3,1.5);
\filldraw[top color=white,bottom color=blue!50!] (2.2,1.65) rectangle node{$P_{4}$} +(1.3,2.0);
\filldraw[top color=white,bottom color=blue!50!] (0.5,2.5) rectangle node{$P_{5}$} +(1.3,2.5);
\filldraw[top color=white,bottom color=blue!50!] (2.2,3.65) rectangle node{$P_{6}$} +(1.3,3.0);
% defining nodes at the points that are the ends of the left brace on the figure
\node[draw] (TopLeftPoint) at (0.5,5.0){box1};
\node[draw] (BottomLeftPoint) at (0.5,0.5){box2};
%changing xshift and yshift values on next line doesn't seem to affect the brace at all
\draw [decorate,decoration={brace,amplitude=10pt},xshift=-400pt,yshift=1000pt]
([xshift=-.7cm]BottomLeftPoint.center) -- ([xshift=-.7cm]TopLeftPoint.center) node [black,midway,xshift=-0.6cm]
{\footnotesize $P_1^*$};
\draw [decorate,decoration={brace,amplitude=10pt,mirror,raise=4pt},yshift=0pt]
(3.5,0.65) -- (3.5,6.5) node [black,midway,xshift=0.8cm] {\footnotesize
$P_2$};
\end{tikzpicture}
\end{document}
Best Answer
amsmath
's\text
can help to obtain the correct size of superscript/subscript fonts in math mode, while the bracing it possible using the traditional\overbrace
/\underbrace
:For other symbols (like arrows), see the Comprehensive LaTeX Symbol List.