Graphics, Figures & TablesCoordinate and scope

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
mas
Posts: 226
Joined: Thu Dec 04, 2008 4:39 am

Coordinate and scope

Post by mas »

I have defined a set of coordinates with labels A, B, C and D. I can draw a line between them. If I try to shift the whole diagram within a scope or use shift, nothing happens. It is as if the definitions are not available. Can someone point me to do it correctly?

Code: Select all

\documentclass[x11names,11pt]{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
  \coordinate (A) at (0,-1) ;
  \coordinate (B) at (2.5,-1.5)  ;
  \coordinate (C) at (-.5,-2.5)  ;
  \coordinate (D) at (-2.5,-1.5) ;

  \draw (A) -- (B) -- (C) -- (D) -- cycle ;
  
  \begin{scope}[yshift=3cm]
    \draw (A) -- (B) -- (C) -- (D) -- cycle ;
  \end{scope}

  \draw[xshift=3cm] (A) -- (B) -- (C) -- (D) -- cycle ;
\end{tikzpicture}

\end{document}
Regards,

sridhar

OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim

Recommended reading 2024:

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

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Coordinate and scope

Post by localghost »

It makes no sense to shift a path with fixed nodes which have been defined outside the scope environment. You will have to find another method. The pgf/tikZ manual surely has a solution.


Best regards
Thorsten
Post Reply