画一个垂直矩形代替水平矩形,并将其尺寸缩小至 3cm x 2cm

画一个垂直矩形代替水平矩形,并将其尺寸缩小至 3cm x 2cm
\documentclass{book}
\usepackage[margin=1in]{geometry}

\usepackage{tikz}
\usetikzlibrary{shapes.geometric, patterns, patterns.meta}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{decorations.pathreplacing,decorations.markings}
\begin{document}
$$\begin{tikzpicture}
\draw [thick] (3,0) -- (0,0) -- (0,3);
\draw [thick,  latex reversed-] (0,3)--(0,5)--(3,5);
\draw [thick, latex reversed-] (3,5) -- (6,5) -- (6,3);
\draw [thick, latex reversed-latex reversed] (6,3) -- (6,0) -- (3,0);
%\draw [dashed] (0,2.5) -- (6,2.5) node [above, pos=.5] {c};
\node [draw=none, anchor=east] at (0,2.5) {};
\node [draw=none, anchor=west] at (6,2.5) {};
\node [draw=none, anchor=east] at (0,3) {b};
\node [draw=none, anchor=west] at (6,3) {b};
\node [draw=none, anchor=east] at (0,0) {};
\node [draw=none, anchor=east] at (0,5) {};
\node [draw=none, anchor=west] at (6,0) {};
\node [draw=none, anchor=west] at (6,5) {};
\node [draw=none, anchor=south] at (3,5) {};
\node [draw=none, anchor=north] at (3,0) {};
\end{tikzpicture}$$
\end{document}

我不知道如何绘制垂直矩形而不是水平矩形,以及如何使其尺寸更小,3x2 厘米见方?有人可以帮我实现这个吗?

在此处输入图片描述

答案1

尝试这个:

\documentclass[border=0.5cm]{standalone}

\usepackage{tikz}


\begin{document} 
    \begin{tikzpicture}
        \draw (0,0) rectangle (2,3);
        \draw[blue,line width=2pt] (0,0) rectangle (3,2);
    \end{tikzpicture}
\end{document}

输出为: 在此处输入图片描述

相关内容