2

I'd like to realize the radiation diagram of the dipole like you can see (both):

I 'd like add a caption. I've tried but I can't find the good program.

I'd like to add arrows to radiation diagram like you can see on the picture.

3

Assuming you are talking about the standard dipoles, whose power goes like sin(theta)^1 (which, in the conventions of pgfplots becomes cos(theta)^2), you could use the 3d and polar plot facilities of pgfplots. For the subfigures I picked a random answer since it seems to be flexible enough to address alignment requirements.

\documentclass{article}
\usepackage{pgfplots} 
\pgfplotsset{width=8cm,compat=1.16}
\usepgfplotslibrary{polar} 
\usepackage{subcaption}
\usepackage{floatrow} % adapted from https://tex.stackexchange.com/a/389970/121799
\begin{document}

\begin{figure}[htb]
\floatsetup{valign=t, heightadjust=all}
\ffigbox{%
\begin{subfloatrow}
\ffigbox{\begin{tikzpicture}
\begin{axis}[view/h=45,axis lines = none,unit vector ratio=1 1 1]
        \addplot3[domain=0:360,domain y=0:360,surf,
    z buffer=sort]
       ({(sin(x+90)*sin(x+90))*cos(y)}, 
        {(sin(x+90)*sin(x+90))*sin(y)}, 
        {(sin(x+90)*sin(x+90))*sin(x)});
\end{axis}
\path(current bounding box.south west) rectangle (current bounding box.north
east);
\end{tikzpicture}}{\caption{3d plot.\label{fig:3dplot}}}
\ffigbox{\begin{tikzpicture}
\begin{polaraxis}[axis lines = none]
    \addplot[domain=0:360,samples=73,smooth] (x+90,{sin(x)*sin(x)});
\end{polaraxis}
\end{tikzpicture}}{\caption{Polar plot.\label{fig:polarplot}}}
\end{subfloatrow}}
{\caption{Dipole.}\label{fig:Dipole}}
\end{figure}
\end{document}

enter image description here

Here is a second option with instructions in case you want a single-color mesh instead for the 3d plot.

\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{pgfplots} 
\pgfplotsset{width=8cm,compat=1.16}
\usepgfplotslibrary{polar} 
\usepackage{subcaption}
\usepackage{floatrow} % adapted from https://tex.stackexchange.com/a/389970/121799
\begin{document}

\begin{figure}[htb]
\floatsetup{valign=c, heightadjust=all}
\ffigbox{%
\begin{subfloatrow}
\ffigbox{\begin{tikzpicture}
\begin{axis}[view/h=45,axis lines = none,unit vector ratio=1 1 1]
        \addplot3[domain=0:360,domain y=0:360,samples=31,
        colormap/blackwhite,surf,%mesh,point meta=1, %<-if you want a mesh
    z buffer=sort]
       ({(sin(x+90)*sin(x+90))*cos(y)}, 
        {(sin(x+90)*sin(x+90))*sin(y)}, 
        {(sin(x+90)*sin(x+90))*sin(x)});
\end{axis}
\path(current bounding box.south west) rectangle (current bounding box.north
east);
\end{tikzpicture}}{\caption{3d plot.\label{fig:3dplot}}}
\ffigbox{\begin{tikzpicture}
\begin{polaraxis}[axis lines = none]
    \addplot[domain=0:360,samples=73,smooth] (x+90,{sin(x)*sin(x)});
\end{polaraxis}
\draw[-stealth] ([yshift=2cm]current axis.south) -- ([yshift=-2cm]current axis.north);
\draw[-stealth] (current axis.west) -- (current axis.east);
\end{tikzpicture}}{\caption{Polar plot.\label{fig:polarplot}}}
\end{subfloatrow}}
{\caption{Dipole.}\label{fig:Dipole}}
\end{figure}
\end{document}

enter image description here

\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{pgfplots} 
\pgfplotsset{width=8cm,compat=1.16}
\usepgfplotslibrary{polar} 
\usepackage{subcaption}
\usepackage{floatrow} % adapted from https://tex.stackexchange.com/a/389970/121799
\begin{document}

\begin{figure}[htb]
\floatsetup{valign=c, heightadjust=all}
\ffigbox{%
\begin{subfloatrow}
\ffigbox{\begin{tikzpicture}
\begin{axis}[view/h=45,axis lines = none,unit vector ratio=1 1 1]
        \addplot3[domain=0:360,domain y=0:360,samples=31,
        mesh,point meta=1, %<-if you want a mesh
    z buffer=sort]
       ({(sin(x+90)*sin(x+90))*cos(y)}, 
        {(sin(x+90)*sin(x+90))*sin(y)}, 
        {(sin(x+90)*sin(x+90))*sin(x)});
\end{axis}
\path(current bounding box.south west) rectangle (current bounding box.north
east);
\end{tikzpicture}}{\caption{3d plot.\label{fig:3dplot}}}
\ffigbox{\begin{tikzpicture}
\begin{polaraxis}[axis lines = none]
    \addplot[domain=0:360,samples=73,smooth] (x+90,{sin(x)*sin(x)});
\end{polaraxis}
\draw[-stealth] ([yshift=2cm]current axis.south) -- ([yshift=-2cm]current axis.north);
\draw[-stealth] (current axis.west) -- (current axis.east);
\end{tikzpicture}}{\caption{Polar plot.\label{fig:polarplot}}}
\end{subfloatrow}}
{\caption{Dipole.}\label{fig:Dipole}}
\end{figure}
\end{document}

enter image description here

Another version. Setting point meta appropriately you can achieve practically any shading.

\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{pgfplots} 
\pgfplotsset{width=8cm,compat=1.16}
\usepgfplotslibrary{polar} 
\usepackage{subcaption}
\usepackage{floatrow} % adapted from https://tex.stackexchange.com/a/389970/121799
\begin{document}

\begin{figure}[htb]
\floatsetup{valign=c, heightadjust=all}
\ffigbox{%
\begin{subfloatrow}
\ffigbox{\begin{tikzpicture}
\begin{axis}[view/h=45,axis lines = none,unit vector ratio=1 1 1]
        \addplot3[domain=0:360,domain y=0:360,samples=31,
        point meta=sqrt(x^2+y^2),
        colormap/blackwhite,surf,%mesh,point meta=1, %<-if you want a mesh
    z buffer=sort]
       ({(sin(x+90)*sin(x+90))*cos(y)}, 
        {(sin(x+90)*sin(x+90))*sin(y)}, 
        {(sin(x+90)*sin(x+90))*sin(x)});
\end{axis}
\path(current bounding box.south west) rectangle (current bounding box.north
east);
\end{tikzpicture}}{\caption{3d plot.\label{fig:3dplot}}}
\ffigbox{\begin{tikzpicture}
\begin{polaraxis}[axis lines = none]
    \addplot[domain=0:360,samples=73,smooth] (x+90,{sin(x)*sin(x)});
\end{polaraxis}
\draw[-stealth] ([yshift=2cm]current axis.south) -- ([yshift=-2cm]current axis.north);
\draw[-stealth] (current axis.west) -- (current axis.east);
\end{tikzpicture}}{\caption{Polar plot.\label{fig:polarplot}}}
\end{subfloatrow}}
{\caption{Dipole.}\label{fig:Dipole}}
\end{figure}
\end{document}

enter image description here

\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{pgfplots} 
\pgfplotsset{width=8cm,compat=1.16}
\usepgfplotslibrary{polar} 
\usepackage{subcaption}
\usepackage{floatrow} % adapted from https://tex.stackexchange.com/a/389970/121799
\begin{document}

\begin{figure}[htb]
\floatsetup{valign=c, heightadjust=all}
\ffigbox{%
\begin{subfloatrow}
\ffigbox{\begin{tikzpicture}
\begin{axis}[view/h=70,axis lines = none,unit vector ratio=1 1 1]
\addplot3[domain=0:360,domain y=0:360,samples=31,
        point meta=sqrt(x^2+y^2),
        colormap/blackwhite,surf,%mesh,point meta=1, %<-if you want a mesh
    z buffer=sort]
       ({(sin(x+90)*sin(x+90))*cos(y)}, 
        {(sin(x+90)*sin(x+90))*sin(y)}, 
        {(sin(x+90)*sin(x+90))*sin(x)});
\pgfplotsinvokeforeach{0,1,...,7}{
\draw[-latex] ({2*cos(#1*45)},{2*sin(#1*45)},0)
-- ({4*cos(#1*45)},{4*sin(#1*45)},0);
\addplot3[samples=81,samples y=1,domain=0:1260,color=blue,thin]
({(x/720+2)*cos(#1*45)},{(x/720+2)*sin(#1*45)},{0.25*sin(x)});
\addplot3[samples=81,samples y=1,domain=0:1260,color=red,thin]
({(x/720+2)*cos(#1*45)-0.25*sin(#1*45)*sin(x)},{(x/720+2)*sin(#1*45)+0.25*cos(#1*45)*sin(x)},{0});
}       
\end{axis}
\path(current bounding box.south west) rectangle (current bounding box.north
east);
\end{tikzpicture}}{\caption{3d plot.\label{fig:3dplot}}}
\ffigbox{\begin{tikzpicture}
\begin{polaraxis}[axis lines = none]
    \addplot[domain=0:360,samples=73,smooth] (x+90,{sin(x)*sin(x)});
\end{polaraxis}
\draw[-stealth] ([yshift=2cm]current axis.south) -- ([yshift=-2cm]current axis.north);
\draw[-stealth] (current axis.west) -- (current axis.east);
\end{tikzpicture}}{\caption{Polar plot.\label{fig:polarplot}}}
\end{subfloatrow}}
{\caption{Dipole.}\label{fig:Dipole}}
\end{figure}
\end{document}

enter image description here

If you have additional requests, may I kindly ask you to ask a new question for that? Asking questions is free, after all.

  • Thanks! and is it possible to add the axes on the polar plot ? and to remove colors on the 3d plot? – Aurélien Dec 31 '18 at 2:52
  • @Aurélien Yes. Do you want only a grid for the 3d plot? – user121799 Dec 31 '18 at 2:52
  • I've got a problem, when I use your code, latex display "the package subcaption can't be use in cooperation with the subfigure package", I can't find a solution .... How can I change the code ? pls – Aurélien Dec 31 '18 at 5:13
  • 1
    @Aurélien My code does not lead to the error message because it does not load subfigure. If you embed it into a code that does, then you need either to remove subfigure there or to use subfigure instead of subcaption. – user121799 Dec 31 '18 at 6:53
  • Ok thanks and I've got one more request...About the colors for the 3d plot, all around the outside should be white, not black and more you are going inside the middle section it should be black. Does this make sense? – Aurélien Dec 31 '18 at 9:33

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.