7

Can you help me with drawing this SGD picture? Colors and sharp effects are welcomed :)

enter image description here

MWE:

\documentclass[11pt]{article}  
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{subfigure}

\usepackage[font=footnotesize]{caption}
\usepackage{pgfplots}
\usepackage{tikz}

% Scriptsize axis style.
\pgfplotsset{every axis/.append style={tick label style={/pgf/number format/fixed},font=\scriptsize,ylabel near ticks,xlabel near ticks,grid=major}}

\begin{document}  
\begin{figure}
    \begin{tikzpicture}[samples=200,smooth]
        \begin{scope}
            \clip(-4,-1) rectangle (4,4);
            \draw plot[domain=0:360] ({cos(\x)*sqrt(20/(sin(2*\x)+2))},{sin(\x)*sqrt(20/(sin(2*\x)+2))});
            \draw plot[domain=0:360] ({cos(\x)*sqrt(16/(sin(2*\x)+2))},{sin(\x)*sqrt(16/(sin(2*\x)+2))});
            \draw plot[domain=0:360] ({cos(\x)*sqrt(12/(sin(2*\x)+2))},{sin(\x)*sqrt(12/(sin(2*\x)+2))});
            \draw plot[domain=0:360] ({cos(\x)*sqrt(8/(sin(2*\x)+2))},{sin(\x)*sqrt(8/(sin(2*\x)+2))});
            \draw plot[domain=0:360] ({cos(\x)*sqrt(4/(sin(2*\x)+2))},{sin(\x)*sqrt(4/(sin(2*\x)+2))});
            \draw plot[domain=0:360] ({cos(\x)*sqrt(1/(sin(2*\x)+2))},{sin(\x)*sqrt(1/(sin(2*\x)+2))});
            \draw plot[domain=0:360] ({cos(\x)*sqrt(0.0625/(sin(2*\x)+2))},{sin(\x)*sqrt(0.0625/(sin(2*\x)+2))});

            \draw[->,blue,ultra thick] (-2,3.65) to (-1.93,3);
            \draw[->,blue,ultra thick] (-1.93,3) to (-1.75,2.4);
            \draw[->,blue,ultra thick] (-1.75,2.4) to (-1.5,1.8);
            \draw[-`enter code here`>,blue,ultra thick] (-1.5,1.8) to (-1.15,1.3);          
            \node at (-1.4,3.8){\scriptsize $w[0]$};
            \node at (-1.2,3.2){\scriptsize $w[1]$};
            \node at (-1.05,2.6){\scriptsize $w[2]$};
            \node at (-0.8,2){\scriptsize $w[3]$};
            \node at (-0.6,1.4){\scriptsize $w[4]$};
        \end{scope}
    \end{tikzpicture}
\end{figure} 
\end{document}

enter image description here

2 Answers 2

9

Possible strategy:

  • Pre-define and name a curved path (called arrowcurve below) with which your plots should intersect.
  • Draw and name all plots in a for-loop (called curve\i below)
  • Find and name all intersections between the curved path and plots.
  • For every interation except the first one, draw an arrow between the preceding and current intersection. Add nodes with desired text along the path.

Bonus update: added a color percentage variable to have plots change color as function of \y.

\documentclass[11pt]{article}  
\usepackage{tikz}
\usetikzlibrary{calc,intersections}

\begin{document}  
\begin{figure}
    \begin{tikzpicture}[samples=50,smooth]
            %\clip(-4,-1) rectangle (4,4);
            \path[bend left,name path=arrowcurve] (-2,4) to[out=-30,in=-160] (0,0);
            \foreach \y[count=\i] in {20,16,12,8,4,1,0.0625}{
            \pgfmathsetmacro\colper{\y*4} % color percentage variable
                \draw[name path global/.expanded=curve\i,white!\colper!black] plot[domain=0:360] ({cos(\x)*sqrt(\y/(sin(2*\x)+2))},{sin(\x)*sqrt(\y/(sin(2*\x)+2))});
                \draw[name intersections = {of ={curve\i} and arrowcurve}](intersection-1) coordinate (P\i);
                \ifnum\i=1 
                    % do nothing
                \else%
                    \pgfmathtruncatemacro\imin{\i-1}
                    \pgfmathtruncatemacro\iprint{\i-2}
                    \draw[->, blue, ultra thick] (P\imin) -- (P\i) node[above right,midway] {\scriptsize $\hat{r}_{\iprint}$}; 
                \fi%
            }     
    \end{tikzpicture}
\end{figure} 
\end{document}

result

7

Slightly simplified imge:

enter image description here

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows.meta,
                quotes,
                shapes.geometric}

\begin{document}
    \begin{tikzpicture}[
dot/.style = {circle, fill, inner sep=2pt,
              node contents={}},
ell/.style = {ellipse, draw=gray, rotate=-5,
              minimum width=2*#1, minimum height=#1,
              node contents={}},
every edge/.style = {draw, -{Triangle[angle=60:1pt 3]},blue,ultra thick},
every edge quotes/.style = {font=\scriptsize, inner sep=1pt, auto, sloped}
                        ]
\node[dot];
\foreach \i [count=\c from 1] in {8, 16, 32, 44, 56}
\node (n\c) [ell=\i mm, line width=11.2/\i pt];
%
\draw
    (n5.north west) edge ["${w[0]}$"] (n4.north west)
    (n4.north west) edge ["${w[1]}$"]  (n3.north west)
    (n3.north west) edge ["${w[2]}$"]  (n2.north west);
    \end{tikzpicture}
\end{document}

Adendum: with bent arrows, without use of node shapes for ellipses:

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows.meta,
                bending,
                intersections,
                quotes,
                shapes.geometric}

\begin{document}
    \begin{tikzpicture}[
every edge/.style = {draw, -{Triangle[angle=60:1pt 3,flex]},
                             bend right=11, blue,ultra thick},
every edge quotes/.style = {font=\scriptsize, inner sep=1pt, 
                            auto, sloped}
                            ]
\fill (0,0) circle[radius=3pt];
\path[name path=C] foreach \i in {4, 8, 16, 22, 28}
        {(0,0) circle[draw=red!\i, x radius=2*\i mm, y radius=\i mm, rotate=-5]};
\foreach \i in  {4, 8, 16, 22, 28}
    \draw[line width=11.2/\i, draw=white!\i!gray]
        (0,0) circle[x radius=2*\i mm, y radius=\i mm, rotate=-5];
\path[name path=V] (-4,2.4) .. controls + (0,-2) and + (-2,0) .. (0,0);
%
\draw [name intersections={of=C and V, sort by=C, name=A}]
        (A-5) edge ["${w[0]}$"] (A-4)
        (A-4) edge ["${w[1]}$"] (A-3)
        (A-3) edge ["${w[2]}$"] (A-2);
    \end{tikzpicture}
\end{document}

enter image description here

5
  • It looks awesome! Though, I’d like to bend the arrows!
    – NaveganTeX
    Commented Jun 24, 2019 at 10:49
  • Is it some way to insure the arrows being perpendicular to the ellipse at start as at the end? Commented Nov 28, 2023 at 1:43
  • @HérissonDidier, it is possible. First you need to determine tangents to ellipse at point of intersections, than draw to it perpendicular lines. However, resulted curve probably will not be as smooth as is now. Ask new question.
    – Zarko
    Commented Nov 28, 2023 at 4:29
  • Thanks. I'm not sure it's necessary to ask a new question Commented Dec 2, 2023 at 18:20
  • @HérissonDidier, if you like to get answer on your question in comment, than you should ask a new question. If my comment is sufficient, that you can solve your problem without of help from of one from this site, even better!
    – Zarko
    Commented Dec 2, 2023 at 18:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .