tikz 随笔

前言

用来存放平时画的一些图,水平很低

正文

直线插补的走步轨迹图

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
\newcounter{jishu}
\setcounter{jishu}{1}
\def\xx{-- node[below] {\footnotesize\thejishu\stepcounter{jishu}} ++ (-1,0)}
\def\yy{-- node[right] {\footnotesize\thejishu\stepcounter{jishu}} ++ (0,1)}
\begin{tikzpicture}[decoration={markings,mark=between positions 0 and 1 step 10mm with {\fill (0,0) circle (0.05);}}]
\draw[-latex] (0,0) -- ++ (0,4) node[right] {$y$};
\draw[-latex] (-6,0) -- ++ (7,0) node[above] {$x$};
\draw (0,0) -- ++ (-5,3);
\draw[-latex,postaction={decorate}] (0,0) \xx\yy\xx\yy\xx\xx\yy\xx;
\foreach \x in {0,...,-5} {\draw (\x,0) -- ++ (0,0.2);\node[below] at (\x,0) {$\x$};}
\foreach \y in {1,...,3} {\draw (0,\y) -- ++ (0.2,0);\node[left] at (0,\y) {$\y$};}
\end{tikzpicture}
\end{document}

效果

文章作者: sikouhjw
文章链接: https://sikouhjw.gitee.io/2020/06/02/2020-06-02-tikz-essays/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 sikouhjw.gitee.io