# Tick numbers on x and y axis

How can I draw the x and y axis so that latex displays the tick numbers on it? (1 unit)

I try:

\begin{center}
\begin{tikzpicture}[scale=0.5]
\draw[very thick,blue] (3,-4) ellipse ({4} and {3});
\end{tikzpicture}
\end{center}

-
Could you please provide a compilable minimal working example (MWE) to work on? –  T. Verron Nov 10 '12 at 18:07
Were you able to solve your other problem of an inscribed square in an ellipse? –  Peter Grill Nov 10 '12 at 19:23
@Peter Grill: yeah, thanks! (it was easy) –  user10 Nov 10 '12 at 20:11
Ok that is good to know. Usually I would recommend not deleting a question as if one person made a mistake others will to at sometime. Also, in the future, please add a comment that you figured it out along with some explanation so those trying to help you can know, and then come back later to delete the question if you really think it is the right thing to do. –  Peter Grill Nov 10 '12 at 21:16

For most graphs I would recommend using pgfplots, but you can manually draw the axis and ticks with a \draw:

## Notes:

• If you want them drawn for each unit, then chnage the \foreach \x in {-1,1,...,8} to \foreach \x in {-1,...,8}, which will change the step size from 2 to 1.

## Code:

\documentclass[border=2pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}

\tikzset{axis line style/.style={thin, gray, -stealth}}

\newcommand*{\TickSize}{2pt}%

\begin{document}
\begin{tikzpicture}[scale=0.5]
\draw[very thick,blue] (3,-4) ellipse ({4} and {3});

\draw [axis line style] (-2.5,0) -- (8.5,0);% x-axis
\draw [axis line style] (0,-8.5) -- (0,2.5);% y-axis

\foreach \x in {-1,1,...,8} {%
\draw ($(\x,0) + (0,-\TickSize)$) -- ($(\x,0) + (0,\TickSize)$)
node [above] {$\x$};
}

\foreach \y in {-7,-5,...,2} {%
\draw ($(0,\y) + (-\TickSize,0)$) -- ($(0,\y) + (\TickSize,0)$)
node [right] {$\y$};
}
\end{tikzpicture}
\end{document}

-