1

How can I scale an arrow so that the scaling is based on its starting point? In my example you see my problem. The black arrow should be scaled down by fifty percent to give the red arrow (as if (0,2) would be the origin). Instead I get the blue arrows, because scaling simply multiplies all the coordinate entries. I tried two methods with the same unwanted behavior. Do you know a simple way to get what I intended? Thanks!

\documentclass{article}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}
\draw [thin,gray!40,step=1] (0,0) grid (4,4);
\node at (-.3,-.3){(0,0)};
\draw [->, very thick] (0,2) -- (4,4);
\draw [->, thick, red] (0,2) -- (2,3);
\draw [->, thick, blue, scale=.5] (0,2) -- (4,4);
\begin{scope}[scale=.25]
\draw [->, thick, blue] (0,2) -- (4,4);
\end{scope}
\end{tikzpicture}

\end{document}

the example

3

If I understand you correctly, you want to scale the length of the arrow down. This suggests to

  1. switch to relative coordinates, i.e. to replace (0,2) -- (4,4) by (0,2) -- ++ (4,2), and then to
  2. just scale the ++ piece, e.g. (0,2) -- ++ ([scale=0.5]4,2).

\documentclass{article}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}
\draw [thin,gray!40,step=1] (0,0) grid (4,4);
\node at (-.3,-.3){(0,0)};
\draw [->, very thick] (0,2) -- (4,4);
\draw [->, thick, red] (0,2) -- (2,3);
\draw [->, thick, blue] (0,2) -- ++ ([scale=.5]4,2);
\draw [->, thick, purple] (0,2) -- ++ ([scale=.25]4,2);
\end{tikzpicture}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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