当前位置:   article > 正文

tikz-坐标、运算、颜色、node_tikz node

tikz node

要点:
- 可以用加减乘除的运算符号,提高易读性,比如2*60,而不是直接写120度;
- 画图设置颜色,比如color=gray;
- draw的时候,多个线段可以放在一个draw命令中,比如下面画OPn的时候,放在一个命令,这可以提高易读性

\begin{tikzpicture}[scale=1]

\coordinate (O) at (0, 0);
\coordinate (P1) at (1, 0);
\coordinate (P2) at (60:1cm);
\coordinate (P3) at (2*60:1cm);
\coordinate (P4) at (3*60:1cm);
\coordinate (P5) at (4*60:1cm);
\coordinate (P6) at (5*60:1cm);

\draw (P1)--(P2)--(P3)--(P4)--(P5)--(P6)--cycle;
\draw [color=gray] (O)--(P1) (O)--(P2) (O)--(P3) (O)--(P4) (O)--(P5) (O)--(P6);

\draw (O) node [below]{O};
\draw (P1) node [right]{P1};
\draw (P2) node [above right]{P2};
\draw (P3) node [above left]{P3};
\draw (P4) node [left]{P4};
\draw (P5) node [below left]{P5};
\draw (P6) node [below right]{P6};

\end{tikzpicture}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22

效果:
这里写图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/238125
推荐阅读
相关标签
  

闽ICP备14008679号