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

I want to draw a coordinate system like this:

enter image description here

I would like to specify the width and height of the coordinate system and where the origin begins (upper left corner). I also want to specify the x and y axes with arrows. Additionally the end of the x and y axis should be indicated with the text "200px".

I'm a LaTeX beginner and am not sure how to do that.

Can anyone recommend a latex package for it?

share|improve this question
The first choices would be TikZ or PsTricks, associated with TikZ you also have pgfplots – Peter Jansson Feb 17 '13 at 14:09
You should look into the package pgf (also named tikz in its front-end layer) or pstricks. Both have amazing drawing capabilities and support just what you request. – zeroth Feb 17 '13 at 14:09
Thank you very much. The TikZ package is great! – Benny Neugebauer Feb 17 '13 at 14:51
up vote 29 down vote accepted

The TikZ package is great! I did the following:


    % TikZ picture with origin upper left
        % 4x4 grid
        \draw (0, 0) grid (4, 4);
        % origin point
        \draw [color=blue, fill=blue] (0, 0) circle (0.1);
        % x-axis
        \draw [thick,->] (0, 0) -- (4.5, 0);
        % y-axis
        \draw [thick,->] (0, 0) -- (0, 4.5);
        % origin label
        \node at (-0.1, -0.5) {(0, 0)};
        % x-axis label
        \node at (4.5, -0.5) {200px};
        % y-axis label
        \node at (0, 5) {200px};



enter image description here

Very helpful: A brief introduction into TikZ

share|improve this answer
This seems to make the boxes checkboxes. If I click one of them in Preview, a checkmark appears. – asmeurer Dec 9 '13 at 19:54

Tikz or pstricks are more powerful but LaTeX has a built in coordinate drawing system, and you really don't need to load an external package for this (although I loaded color)

enter image description here



\put(4,0){\makebox(0,0)[cb]{\tiny x}}
\put(0,-4){\makebox(0,0)[cr]{\tiny y`}}


share|improve this answer
It's good that this has a non-TikZ answer, but I feel like this is a good example of why bloated packages like TikZ or PSTricks are useful even for rather simple tasks. Man, code for graphics with plain LaTeX is scary! – Jake Feb 17 '13 at 15:30
Thank you for this! It's good to know that the standard can do this. But I prefer the TikZ-way. :) – Benny Neugebauer Feb 17 '13 at 19:01

With PSTricks.


enter image description here

It is also possible to create non-orthogonal coordinate system with PSTricks as follows. Here, OI and OJ are the unit vectors that are parallel to x and y axes, respectively.



enter image description here

It might be unavailable in TikZ or others.


The syntax of \pstOIJGeonode is a bit uncommon as follows.


The first point A1 must come right after \pstOIJGeonode but the remaining points A2, ..., An must come right after {O}{I}{J}. I don't know why the author made such a strange syntax.

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.