Graphics, Figures & TablesTikZ - Default Graph Size, Adjusting It

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
LaTexLearner
Posts: 139
Joined: Tue Mar 10, 2015 11:06 am

TikZ - Default Graph Size, Adjusting It

Post by LaTexLearner »

I am just getting started on TikZ and am wondering what the default size is for TikZ graphs. I made the arbitrary graph below and printed it and it seems that each unit is a little smaller than 1cm.

What is the default size for graphs? And how is it adjusted?

Code: Select all


\documentclass[12pt,letterpaper]{article}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}

\draw[help lines] (-1,-1) grid (4,4);

\draw (0,0)--(3,4)--(4,-1)--(-1,-0.4);

\draw (0,0)--(2,4);

\end{tikzpicture}

\end{document}

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

TikZ - Default Graph Size, Adjusting It

Post by Johannes_B »

There could be multiple reasons for that behaviour, most likely the printer driver does some monkey business. Check if the autifit option is not set. Usually, this is the troublemaker. If TeX should really be off, it is by a few angstrom, meaning the one or two atoms of a chemical element in diameter.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
LaTexLearner
Posts: 139
Joined: Tue Mar 10, 2015 11:06 am

TikZ - Default Graph Size, Adjusting It

Post by LaTexLearner »

Johannes_B wrote:There could be multiple reasons for that behaviour, most likely the printer driver does some monkey business.
Yup, that was it... my PDF reader/driver was scaling everything down for no reason. Everything fit comfortably inside the margins pre-scaling... Not sure what the scaling down was for.

Thanks!
Post Reply