Using TikZ, I would like to create a coordinate plane which describes the rectangular coordinates (x,y). However, I'm not sure how to go about doing this. Here is an example of something I am trying to do:


However, I only want one point, and keep the x and y axes graphed. Also, I would like to have variable representing the coordinate, like (x,y) written instead of (2,3). Finally, I would like (0,x) and (x,0) to be written where the points would be, but without the points actually graphed.

  • What have you tried so far? Posting the code for the image would be a good start - or whatever you have towards it. So where the x axis has the mark 2 you also want to have a label (x,0)? (Or did you really mean (0,x)? I was assuming a typo.) Won't that be rather confusing?
    – cfr
    Oct 18, 2015 at 0:46

3 Answers 3



enter image description here


Next time, please provide at least some code for people to work with. Automation, simplification and modification are left as an exercise for the reader.

    \path [draw, help lines, opacity=.5]  (-11,-11) grid (11,11);
    \foreach \i in {1,...,10} \draw (\i,2.5pt) -- +(0,-5pt) node [anchor=north, font=\small] {$\i$} (-\i,2.5pt) -- +(0,-5pt) node [anchor=north, font=\small] {$-\i$} (2.5pt,\i) -- +(-5pt,0) node [anchor=east, font=\small] {$\i$} (2.5pt,-\i) -- +(-5pt,0) node [anchor=east, font=\small] {$-\i$};
    \draw [->] (-10,0) -- (10,0) node [anchor=south] {$x$};
    \draw [->] (0,-10) -- (0,10) node [anchor=west] {$y$};
    \path [draw=blue, ultra thick, text=blue, densely dashed] (0,6) node [anchor=south west] {$(0,y)$} -| (8,0) node [anchor=south west] {$(x,0)$} node [anchor=south west, midway] {$(x,y)$};

Cartesian plane


Here is the exact reproduction of the picture using tkz-euclide.

    \tkzDrawSegments[color=blue, ultra thick, densely dashed](A,B B,C)
    \tkzLabelPoint[above right,color=blue](A){$(0,3)$}
    \tkzLabelPoint[above right,color=blue](B){$(2,3)$}
    \tkzLabelPoint[above right,color=blue](C){$(2,0)$}
    \tkzDrawSegments[color=red, ultra thick, densely dashed](D,E E,F)
    \tkzLabelPoint[above left,color=blue](D){$(0,1)$}
    \tkzLabelPoint[above left,color=blue](E){$(-3,1)$}
    \tkzLabelPoint[above left,color=blue](F){$(-3,0)$}
    \tkzDrawSegments[color=red, ultra thick, densely dashed](G,H H,I)

    \tkzLabelPoint[above right,color=blue]({0,0}){$(0,0)$}

enter image description here

Since this is repetitive code, the number of lines can be reduced by two third. But I left it more verbose so that it is easy to follow.

  • Just an update, \usetkzobj{all} is not required for the time being.
    – Cenk
    May 9, 2020 at 8:08

You must log in to answer this question.

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