我必须绘制这些矢量,带有网格和网格(如图所示)。我在网上搜索过,但无法解决我的问题。你能帮助我吗?
\documentclass[a4paper]{minimal}
\usepackage[centering,margin=0.5cm]{geometry}
\usepackage{tikz}
\pagestyle{empty}
\begin{document}
\noindent\begin{tikzpicture}[color=gray]
%\draw[line width=0.10pt, step=1.0mm] (0,0) grid +(20cm,28cm);
%\draw[line width=0.25pt, step=5.0mm] (0,0) grid +(20cm,28cm);
\draw[line width=0.05pt, step=0.5cm] (0,0) grid +(10cm,5cm);
\end{tikzpicture}
\end{document}
我想画出如图所示的角。并且想在角内添加颜色。
答案1
从您的 MWE 到下面的图片只是一小步:
\documentclass[a4paper]{minimal}
\usepackage[centering,margin=2cm]{geometry}
\usepackage{tikz}
\pagestyle{empty}
\begin{document}
\noindent\begin{tikzpicture}[> = stealth]
\draw[gray,step=1cm] (0,0) grid +(9cm,6cm);
\draw[ultra thick,red, ->] (1,4) -- node[above] {$\vec{a}$} +(2,0);
\draw[ultra thick,blue,->] (1,3) -- node[below left] {$\vec{b}$} +(1,-2);
%
\draw[ultra thick,red, ->] (4,4) -- node[above] {$\vec{a}$} +(1,0);
\draw[ultra thick,blue,->] (4,4) -- node[below left] {$\vec{b}$} +(1,-2);
%
\draw[ultra thick,blue,|-|] (6,1) -- node[below] {$u$} +(1,0);
\end{tikzpicture}
\end{document}