Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to rotate a node and then shift it along the X axis. If I do [rotate=90, xshift=-20pt], the node will first shift and then rotate.

share|improve this question
    
You need to change the order of the transformations. The first transformation applied is the last of the options. –  Alain Matthes Dec 26 '11 at 7:52
add comment

2 Answers 2

up vote 7 down vote accepted

You could nest the rotated object inside a shifted scope, i.e.

\begin{scope}[xshift=-20pt]
    \draw [rotate=90] ...;
\end{scope}
share|improve this answer
add comment

The scope is not necessary. You have two solutions

1) with cm={0,1,-1,0,(-20pt,0cm)}

2) you can try to change the order of your transformations with xshift=-20 pt,rotate=90and not rotate=90,xshift=-20 pt.

\documentclass{scrartcl}
\usepackage{tikz} 

\begin{document}

\begin{tikzpicture}   
 \draw[red,->] (0,0) -- (1,1);   
 \draw[blue,->,cm={0,1,-1,0,(-20pt,0cm)}] (0,0) -- (1,1);
\end{tikzpicture}

\begin{tikzpicture}
 \draw[red,->] (0,0) -- (1,1);   
 \draw[blue,->,xshift=-20 pt,rotate=90]  (0,0) -- (1,1);
 \draw[green,->,rotate=90,xshift=-20 pt] (0,0) -- (1,1);
\end{tikzpicture}

\end{document} 

enter image description here

share|improve this answer
    
Ah, didn't know that the order had such an effect. Well, I'll remember that till next time. –  gablin Dec 27 '11 at 8:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.