TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

I try:

\draw[very thick,blue] (3,-4) ellipse ({4} and {3});
share|improve this question
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:

enter image description here


  • 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.



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


\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$};
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.