2

I want to draw a coordinate system and/or Grid lines like this: enter image description here

I'm a LaTeX beginner and am not sure how I can use as a package to draw it.

Can anyone recommend a latex package for it?

Achaire
  • 107
  • 1
    You mention tikz, but have you tried it yet? The documentation can be intimidating, but it contains many useful tutorials. – erik Nov 14 '16 at 15:03
  • 2
    Maybe http://cremeronline.com/LaTeX/minimaltikz.pdf could be helpfull. – samcarter_is_at_topanswers.xyz Nov 14 '16 at 15:05
  • 1
    Or "2.7 Grid Path Construction" from http://mirrors.ctan.org/graphics/pgf/base/doc/pgfmanual.pdf – samcarter_is_at_topanswers.xyz Nov 14 '16 at 15:06
  • 1
    Some inspiration: http://tex.stackexchange.com/questions/96416, http://tex.stackexchange.com/questions/61805, http://tex.stackexchange.com/questions/305740, http://tex.stackexchange.com/questions/150038 – Torbjørn T. Nov 14 '16 at 15:14
  • Thank you for these documents, I will try to draw it. But, I think it is not easy to build $u_1$ and $u_2$ for a beginner -;) – Achaire Nov 14 '16 at 15:24
  • 3
    @Achaire, I think this is a very good example to learn TikZ. I agree with the others. Have a look at the tutorials in the tikzmanual to get knowledge of "how to think" when you want to draw something (because there are many ways to get the desired result, but some of them are better/shorter than others). When you know how to design the image, then it is just scrolling in the manual to find out how to draw the it. When you have drawn something you are welcome to edit your question and post your code there. Then we will be happy to help you. – Stefan Pinnow Nov 14 '16 at 17:12

1 Answers1

6

You can utilize Tikz to achieve the image you've posted. See the result below

enter image description here

The code for the preceding output is

\documentclass[border={10pt}]{standalone}

\usepackage{tikz}
\usetikzlibrary{positioning}

\begin{document}

\begin{tikzpicture}
    [%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        dot/.style={circle,draw=black, fill,inner sep=1pt}, 
        line/.style={-latex,thick}       
    ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\draw[step=1cm,gray,dashed] (-1,-1) grid (7,7);

\foreach \x in {0,...,6}{
    \foreach \y in {0,...,6} {
        \node[dot] at (\x,\y){ };
}}
\draw[line,green] (0,2) -- node[above,xshift=-2mm]{$u_2$}(1,4);
\draw[line,green] (0,2) -- node[above,xshift=-1mm]{$u_1$}(3,4);
\draw[line,red] (3,1) -- node[left]{$v_2$}(3,2);
\draw[line,red] (3,1) -- node[below]{$v_1$}(4,1);
\end{tikzpicture}

\end{document}
CroCo
  • 5,902
  • (+1) One detail: ->,-latex is a bit more than necessary, just -latex is enough. You could also say ->,>=latex, where the first part says to add an arrow tip, while the second says set default arrow tip to latex. – Torbjørn T. Nov 14 '16 at 20:53
  • @TorbjørnT., nice catch. I will update it. – CroCo Nov 14 '16 at 20:55