2

I want to write an essay about vector fields, and give an example using the bath-tub example. I want to get a figure similar to this one:

Enter image description here

The figure source: https://www.youtube.com/watch?v=0jW74lrpeM0&t=269s

Also if there's any function that produces a similar figure it's okay.

1
  • Draw step-by-step each arrow by your hand, easy! Aug 30, 2021 at 3:07

1 Answer 1

7

Is that what you want? I just decorate with arrows along the Bezier curves.

enter image description here

\documentclass[tikz,border=5mm]{standalone}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}[myarr/.style={decoration={markings,
mark=between positions 0.08 and .96 step #1
with { 
\draw[-stealth] (-.15,0)--(.15,0);
}},postaction={decorate}}]

%\draw[gray!50] (-2,-2) grid (6,2);
\clip (-2,-2) rectangle (6,2);
\path[red,myarr=.2] (0,0)--(4,0);
\path[red,myarr=.15] (0,0) .. controls +(30:1) and +(180-30:1) .. (4,0);
\path[red,myarr=.15] (0,0) .. controls +(60:1.5) and +(180-60:1.5) .. (4,0);
\path[red,myarr=.1] (0,0) .. controls +(90:2) and +(180-90:2) .. (4,0);
\path[red,myarr=.08] (0,0) .. controls +(120:3) and +(180-120:3) .. (4,0);
\path[red,myarr=.04] (0,0) .. controls +(150:6) and +(180-150:6) .. (4,0);
\path[red,myarr=.02] (0,0) .. controls +(165:15) and +(180-165:15) .. (4,0);
\path[red,myarr=.12] (0,0)--(-2,0) (6,0)--(4,0);

\path[red,myarr=.15] (0,0) .. controls +(-30:1) and +(180+30:1) .. (4,0);
\path[red,myarr=.15] (0,0) .. controls +(-60:1.5) and +(180+60:1.5) .. (4,0);
\path[red,myarr=.1] (0,0) .. controls +(-90:2) and +(180+90:2) .. (4,0);
\path[red,myarr=.08] (0,0) .. controls +(-120:3) and +(180+120:3) .. (4,0);
\path[red,myarr=.04] (0,0) .. controls +(-150:6) and +(180+150:6) .. (4,0);
\path[red,myarr=.02] (0,0) .. controls +(-165:15) and +(180+165:15) .. (4,0);

\fill[blue] (0,0) circle(2pt) (4,0) circle(2pt);
\end{tikzpicture}
\end{document}

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.