Graphics, Figures & TablesHelp in understanding the coordinate system used by TikZ

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
stdq
Posts: 3
Joined: Mon Feb 23, 2015 12:31 am

Help in understanding the coordinate system used by TikZ

Post by stdq »

Can anyone explain it to me? Where is the origin? And, in the following command, what do the first and second points mean?

Code: Select all

\path [fill=green] (-4.13,-4.95) rectangle (2,2);
I've been changing the code constantly, but I can't seem to figure it out. Thanks in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Help in understanding the coordinate system used by TikZ

Post by Johannes_B »

It spans a rectangle from -4.13x and -4.95y to 2x and 2y. It is filled green. The origin is at 0x,0y obviously.
The picture created is a box, LaTeX treats it as a (big) letter.


Have a look at the manual, it has a very good tutorial.

Code: Select all

\documentclass{article}
\usepackage{tikz}
\begin{document}
wombat
\begin{tikzpicture} 
\path [fill=green] (-4.13,-4.95) rectangle (2,2);
\draw (0,0) circle (1pt);
\end{tikzpicture}
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply