# “Waved lines” on a 2D coordinate system [duplicate]

Good evening everyone. I have this code that I slightly need to modify to make the "wave curves" as showed in photo I attach here.

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw [thick, gray, ->] (0,-1) -- (0,5)      % draw y-axis line
node [above, black] {$x_{3}$};              % add label for y-axis
\draw [thick, gray, ->] (-5,0) -- (5,0)      % draw x-axis line
node [right, black] {$x_{2}$};              % add label for x-axis

\draw [thick, black, ->] (0,0) -- (-4,4)      % draw y-axis line
node [above, black] {$x^{'}_{3}$};              % add label for y-axis
\draw [thick, black, ->] (0,0) -- (4,4)      % draw x-axis line
node [right, black] {$x^{'}_{2}$};              % add label for x-axis

\filldraw[fill opacity=0.1,fill=blue] (0,0) -- (1,0) arc (0:135:1cm) node[midway,above,opacity=1.0]{$\theta$} -- cycle;
\filldraw[fill opacity=0.1,fill=red] (0,0) -- (2,0) arc (0:45:2.0cm) node[midway,right,opacity=1.0]{$\phi=\theta-90^{\circ}$} -- cycle;

\end{tikzpicture}

\end{document}


Does anyone know if it's possible to realize something similar to the attached photo and how to do it? Thanks a lot in advance :)

## marked as duplicate by Mico, Kurt, user36296, CarLaTeX, TroyJul 29 '17 at 17:45

• Check out decoration=snake on page 55 (pgf manual). – John Kormylo Jul 29 '17 at 15:10
• – Bobyandbob Jul 29 '17 at 15:11

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}

\begin{document}
\begin{tikzpicture}[
S/.style = {% Snake
->, decorate,
decoration={snake,amplitude=2mm,segment length=5mm,post length=2mm},
draw=#1, thick
}
]
% axes
\path [draw=gray, thick, ->] (0,-1) -- (0,5) node [above] {$x_{3}$};
\path [draw=gray, thick, ->] (-5,0) -- (5,0) node [right] {$x_{2}$};
% rotated axes
\path [draw=gray, thick, ->] (0,0) -- (-4,4) node [above] {$x^{'}_{3}$};
\path [draw=gray, thick, ->] (0,0) -- ( 4,4) node [right] {$x^{'}_{2}$};
% angles
\filldraw[fill=blue, fill opacity=0.1]
(0,0) -- (1,0) arc (0:135:1cm) node[midway,above, text opacity=1] {$\theta$} -- cycle;
\filldraw[fill opacity=0.1,fill=red]
(0,0) -- (2,0) arc (0: 45:2cm) node[midway,right, text opacity=1] {$\phi=\theta-90^{\circ}$} -- cycle;
% snakes
\draw [S= red] ( 30:22mm) -- ++ ( 45:21mm);
\draw [S= red] ( 60:22mm) -- ++ ( 45:21mm) node[above right] {$Q_1$};
%
\draw [S=blue] (120:22mm) -- ++ (135:21mm) node[above left] {$Q_2$};
\draw [S=blue] (150:22mm) -- ++ (135:21mm);
\end{tikzpicture}
\end{document}

• This is beautiful. (But why "exponentiate" the dashes in the tilted axis labels?) – giobrach Jul 29 '17 at 15:21
• ups, now i see, that MWE is not complete ... I will correct this asap – Zarko Jul 29 '17 at 15:39
• I complete MWE. for snakes I use polar coordinates because they have in this case simpler code. You can replace with Cartesian one, if you more prefer them. This should not be big deal :) – Zarko Jul 29 '17 at 15:48