[latex]PGF 和 tikz中如何旋转图形的示例

tikz中如何旋转图形的示例:

测试旋转:\\
\begin{tikzpicture}[line width =2pt]
%原始图
\draw[dashed] (0,0) rectangle (2,2);
%旋转45度,取默认旋转点
\draw[rotate=45] (0,0) rectangle (2,2);
%旋转45度,指定旋转点(2,2)
\draw[rotate around={45:(2,2)},blue] (0,0) rectangle (2,2);
%辅助信息
\draw[fill=red] (0,0) circle (4pt);
\draw[fill=green](2,2) circle (4pt);
\node[below] (nodea) at (0,0){$(0,0)$};
\node[above] (nodeb) at (2,2){$(2,2)$};
\end{tikzpicture}


 

运行结果为:

 

旋转node也可一样设置

 

posted @ 2013-03-28 21:14  xinyuyuanm  阅读(938)  评论(0编辑  收藏  举报