Diagrams – Drawing Electric Field of a Dipole with LaTeX

diagrams

I want to create a picture like this:
enter image description here

but I don't know how! is there any body to help me?
Thanks a lot!

Best Answer

Welcome! It is not too difficult to draw something of that sort. Of course, this assumes you want a cartoon.

\documentclass[tikz,border=3mm]{standalone}
\usepackage{mathpazo}
\usetikzlibrary{decorations.markings,arrows.meta,bending}
\tikzset{% 
    attach arrow/.style={
    decoration={
        markings,
         mark=at position 0 with {\pgfextra{%
         \pgfmathsetmacro{\tmpArrowTime}{\pgfkeysvalueof{/tikz/arc arrow/length}/(\pgfdecoratedpathlength)}%
         \xdef\tmpArrowTime{\tmpArrowTime}}},
        mark=at position {#1-3*\tmpArrowTime} with {\coordinate(@1);},
        mark=at position {#1-2*\tmpArrowTime} with {\coordinate(@2);},
        mark=at position {#1-1*\tmpArrowTime} with {\coordinate(@3);},
        mark=at position {#1+\tmpArrowTime/2} with {\coordinate(@4);
        \draw[-{Stealth[length=\pgfkeysvalueof{/tikz/arc arrow/length},bend]}] plot[smooth]
         coordinates {(@1) (@2) (@3) (@4)};},
        },
     postaction=decorate,
     },
     attach arrow/.default=0.5,
     arc arrow/.cd,length/.initial=2mm,
}
\begin{document}
\begin{tikzpicture}
\path node[circle,inner sep=1ex] (L){} (5,0) node[circle,inner sep=1ex] (R){};
\foreach \X in {0,...,7}
 {\draw[very thick,orange,attach arrow] (L) 
 to[out={-70+\X*20+8*rnd-4},in={180+70-\X*20+8*rnd-4},looseness=1.6] 
 (R);}
\foreach \X in {0,...,10}
 {\draw[very thick,orange,attach arrow] (L) to[bend left=16-4*\X+2*rnd-4] ++ (70+\X*22:3);
 \draw[very thick,orange,attach arrow] (R)+(180+70+\X*22:3) to[bend right=16-4*\X+2*rnd-4] 
  (R);}
\path[inner color=white,outer color=orange,shift={(L)}] 
 plot[smooth cycle,samples at={0,15,...,345}]
 (\x:{0.6+0.2*cos(\x)+0.2*cos(2*\x)});
\path[inner color=white,outer color=blue!30,shift={(R)}] 
 plot[smooth cycle,samples at={0,15,...,345}]
 (\x:{0.6+0.2*cos(\x+180)+0.2*cos(2*\x)});
\path (L.east) node{$+Q$} (R.west) node{$-Q$} ;
\end{tikzpicture}
\end{document}

enter image description here