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

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

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