我的两个支架中的第一个(左边的支架)没有按预期出现。我怎样才能让它向下?
\documentclass[]{article}
\usepackage{tikz}
\usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,%
decorations.pathreplacing,decorations.pathmorphing,shapes,%
matrix,shapes.symbols}
\begin{document}
\begin{figure}[h]
%\centering
\begin{tikzpicture}
\node (rect) at (2.25,0.5) [draw,thick,minimum width=0.5cm,minimum height=1cm] {A};
\node (rect2) at (3.25,0.5) [draw,thick,minimum width=0.9cm,minimum height=1cm] {};
\node (rect3) at (5.25,2) [draw,dashed,minimum width=0.5cm,minimum height=1cm] {A};
\node (rect4) at (5.95,2) [draw,thick,minimum width=0.35cm,minimum height=1cm,label = south:{B}] {};
\node (rect5) at (6.45,2) [draw,thick,minimum width=0.2cm,minimum height=1cm,label = south:{C}] {};
\draw [thick,->] (rect2)-- (rect3);
\node (rect6) at (5.25,0) [draw,thick,minimum width=0.5cm,minimum height=1cm] {A};
\node (rect7) at (5.95,0) [draw,thick,minimum width=0.35cm,minimum height=1cm] {};
\node (rect8) at (6.45,0) [draw,thick,minimum width=0.2cm,minimum height=1cm] {};
\draw [thick,->] (rect2)--(rect6) ;
\node (rect9) at (5.45,-2) [draw,thick,minimum width=0.85cm,minimum height=1cm] {A'};
\node (rect10) at (6.1,-2) [draw,thick,minimum width=0.2cm,minimum height=1cm] {};
\draw[thick,->] (rect2)--(rect9);
\draw [decorate,decoration={brace,amplitude=6pt,raise=2pt,aspect=0.5}] (rect4.north west) -- (rect5.north east);
\draw [decorate,decoration={brace,amplitude=6pt,raise=2pt}] (rect.south west) -- (rect2.south east);
\end{tikzpicture}
\caption{Worst case of Algorithm 1. Factorial time}
\label{fig:6forces}
\end{figure}
\end{document}
答案1
用于mirror
\draw [decorate,decoration={brace,amplitude=6pt,raise=2pt,mirror}] (rect.south west)
-- (rect2.south east);
代码:
\documentclass[]{article}
\usepackage{tikz}
\usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,%
decorations.pathreplacing,decorations.pathmorphing,shapes,%
matrix,shapes.symbols}
\begin{document}
\begin{figure}[h]
%\centering
\begin{tikzpicture}
\node (rect) at (2.25,0.5) [draw,thick,minimum width=0.5cm,minimum height=1cm] {A};
\node (rect2) at (3.25,0.5) [draw,thick,minimum width=0.9cm,minimum height=1cm] {};
\node (rect3) at (5.25,2) [draw,dashed,minimum width=0.5cm,minimum height=1cm] {A};
\node (rect4) at (5.95,2) [draw,thick,minimum width=0.35cm,minimum height=1cm,label = south:{B}] {};
\node (rect5) at (6.45,2) [draw,thick,minimum width=0.2cm,minimum height=1cm,label = south:{C}] {};
\draw [thick,->] (rect2)-- (rect3);
\node (rect6) at (5.25,0) [draw,thick,minimum width=0.5cm,minimum height=1cm] {A};
\node (rect7) at (5.95,0) [draw,thick,minimum width=0.35cm,minimum height=1cm] {};
\node (rect8) at (6.45,0) [draw,thick,minimum width=0.2cm,minimum height=1cm] {};
\draw [thick,->] (rect2)--(rect6) ;
\node (rect9) at (5.45,-2) [draw,thick,minimum width=0.85cm,minimum height=1cm] {A'};
\node (rect10) at (6.1,-2) [draw,thick,minimum width=0.2cm,minimum height=1cm] {};
\draw[thick,->] (rect2)--(rect9);
\draw [decorate,decoration={brace,amplitude=6pt,raise=2pt,aspect=0.5}] (rect4.north west) -- (rect5.north east);
\draw [decorate,decoration={brace,amplitude=6pt,raise=2pt,mirror}] (rect.south west) -- (rect2.south east);
\end{tikzpicture}
\caption{Worst case of Algorithm 1. Factorial time}
\label{fig:6forces}
\end{figure}
\end{document}