could help me to get a macro to draw such axis if I specify :
- the beginning and the end of the axis (not necessarily integers)
- how it should be graduated
- a list of points with coordinates and names
Here are two examples :
\begin{tikzpicture}[scale=1.2]
\draw[->] (0,0) --(7.2,0);
\foreach \x in {0,...,70}{\draw [color=violet](\x/10,0.1)--(\x/10,-0.1);}
\foreach \x in {0,1,...,7}{\draw[thick] (\x,0.2)--(\x,-0.2);\node at (\x,0.4) {$\x$};}
\node at (2.4,-0.6) {$A$};
\draw[->] (2.4,-0.4)--(2.4,-0.1) {};
\node at (5.7,-0.6) {$B$};
\draw[->] (5.7,-0.4)--(5.7,-0.1) {};
\end{tikzpicture}
or
\begin{tikzpicture}[scale=1]
\draw[->] (0,0) --(10.2,0);
\draw[thick] (0,0.4)--(0,-0.4);
\node at (0,0.8) {$3$};
\foreach \x in {0,...,99}{\draw[thin] [color=blue](\x/10,0.1)--(\x/10,-0.1);}
\foreach \x in {1,...,9}{\draw [color=violet](\x,0.2)--(\x,-0.2);}
\draw[thick] (10,0.4)--(10,-0.4);\node at (10,0.8) {$4$};
\node at (2.4,-0.6) {$E$};
\draw[->] (2.4,-0.4)--(2.4,-0.1) {};
\node at (5.7,-0.6) {$D$};
\draw[->] (5.7,-0.4)--(5.7,-0.1) {};
\end{tikzpicture}
Thanks