Graphics, Figures & Tablestikz node positioning

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
CoolnessItself
Posts: 47
Joined: Wed Nov 11, 2009 9:30 pm

tikz node positioning

Post by CoolnessItself »

I'm trying to make someone to-scale. I know the positions (see code)

Code: Select all

\documentclass[minimal]{article}

\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\draw[fill=black] (30.3mm,17.5mm) circle (1mm);
\draw[fill=black] (-21.5mm,-23.0mm) circle (1mm);
\draw[fill=black] (-30.1mm,-9.2mm) circle (1mm);
\end{tikzpicture}
\end{document}
It's not necessary that they actually appear at 30.3mm when printed or on the screen, but their spacing should be proportional.

Is this possible?


It looks like this
Attachments
Untitled.png
Untitled.png (16.86 KiB) Viewed 3154 times

Recommended reading 2024:

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

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

mas
Posts: 226
Joined: Thu Dec 04, 2008 4:39 am

Re: tikz node positioning

Post by mas »

Your figure shows 1 point at a different location than what you have specified. Changing the following line

\draw[fill=black] (-30.1mm,-9.2mm) circle (1mm);

to

\draw[fill=black] (-30.1mm,9.2mm) circle (1mm);

should give you the proper spacing.

Regards,

OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim
CoolnessItself
Posts: 47
Joined: Wed Nov 11, 2009 9:30 pm

Re: tikz node positioning

Post by CoolnessItself »

oops! embarrassing! And here I was thinking it was a problem with tikz!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

tikz node positioning

Post by localghost »

To get closer to what you like to have, you can simply use the pgfplots package.

Code: Select all

\documentclass{minimal}
\usepackage{pgfplots}

\begin{document}
  \begin{tikzpicture}
    \begin{axis}[%
      xmin=-40,xmax=40,ymin=-40,ymax=20,
      xtick={-40,-30,...,40},
      ytick={-40,-30,...,20}
    ]
      \addplot+[only marks] coordinates {(-30.1,9.2) (-7.6,-30.1) (30.3,16.7)};
    \end{axis}
  \end{tikzpicture}
\end{document}

Thorsten
Post Reply