8

enter image description here

I tried tikzpicture, but the arrow is too thin. also, I don't know how to draw the coordinate system, and put the label at the end of the arrow.

\begin{tikzpicture}

    \draw[->, ultra thick, blue,  arrows={-latex}]  (0,0) -- (1,1) node[sloped,midway,above=-0.1cm] {$\mathsf{v}$};

\end{tikzpicture}

2 Answers 2

12
\documentclass{article}
\usepackage{tikz}
\usepackage{amsmath}
\begin{document}
\begin{tikzpicture}
  \draw[thin,gray!40] (-2,-2) grid (2,2);
  \draw[<->] (-2,0)--(2,0) node[right]{$x$};
  \draw[<->] (0,-2)--(0,2) node[above]{$y$};
  \draw[line width=2pt,blue,-stealth](0,0)--(1,1) node[anchor=south west]{$\boldsymbol{u}$};
  \draw[line width=2pt,red,-stealth](0,0)--(-1,-1) node[anchor=north east]{$\boldsymbol{-u}$};
\end{tikzpicture}
\end{document}

enter image description here

6

Another simple solution, with pstricks (compilable with pdflatex if you use the --enable-write18 switch for MiKTeX, -shell-escape for TeX Live and MacTeX):

\documentclass[svgnames, border=3pt]{standalone}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{pst-plot}
\usepackage{auto-pst-pdf}


\begin{document}

\psset{arrowinset=0.12, labels = none, ticks=none, fillstyle=solid}
\begin{pspicture}%
\psgrid[gridlabels=0pt, gridwidth=0.3pt, gridcolor=LightSteelBlue, subgriddiv=1, subgridwidth=0pt](-2,-2)(2,2)
    \psaxes[arrows=<->] (0,0)(-2,-2)(2,2)
\psset{arrows=->}
\psline[linecolor=SteelBlue, linewidth=1.8pt](0,0)(1,1)
\uput[r](1,1){$\color{SteelBlue}\mathbf{u}$}
\psline[linecolor=IndianRed, linewidth=1.8pt](0,0)(-1,-1)
\uput[l](-1,-1){$\color{IndianRed}\mathbf{-u}$}
\end{pspicture}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .