# TIKZ drawing vector field

How can i draw a vector field like this?

• In the meantime have a look here: tex.stackexchange.com/questions/34004/… – Dr. Manuel Kuehner Apr 28 '18 at 23:21
• Look for Quiver Plot – Dr. Manuel Kuehner Apr 28 '18 at 23:21
• In addition to @Dr.ManuelKuehner's link I'd suggest this post and this answer. – user121799 Apr 28 '18 at 23:29
• This doesn't look like a vector field : you have curved arrows in your picture. Is this supposed to represent a flow of a vector field ? In any case you should precise your question, I think. – Kpym Apr 29 '18 at 4:00

Yes, I know this question has TikZ in the title. Nevertheless I'd like to present an asymptote solution since IMHO this does a much better job on real 3D graphics. Compile with pdflatex -shell-escape.

\documentclass[border=5pt]{standalone}
\usepackage{asypictureB}
\begin{document}
\begin{asypicture}{name=AsyVF}
import graph3;
import three;
import solids;

size(6cm,8cm);
settings.render = 4;
currentlight=(2,15,5);

// coordinate axes
draw(-Z -- 2X-Z,L=Label("$x$",position=EndPoint));
draw(-Z -- 3Y-Z,L=Label("$y$", position=EndPoint));
draw(-Z -- 2Z,L=Label("$z$", position=EndPoint));

for (int irun=1; irun<=20; irun+=1)
{
real myx = sin(irun*2*pi/20);
real myy = -0.5;
real myz = cos(irun*2*pi/20);
draw(myx*X+myy*Y+myz*Z -- myx*X+myy*Y+myz*Z+(0.8+0.3*sin(irun*2*pi/10))*Y, arrow=Arrow3(), p=linewidth(0.5pt),light=currentlight);
//draw(shift(myx*X+myy*Y+myz*Z)*scale3(0.05)*unitsphere,lightgray,light=currentlight);
}

for (int irun=1; irun<=20; irun+=1)
{
real myx = sin(irun*2*pi/20);
real myy = 0.8;
real myz = cos(irun*2*pi/20);
draw(myx*X+myy*Y+myz*Z -- 1.2*myx*X+myy*Y+1.2*myz*Z+1.1*Y, arrow=Arrow3(), p=linewidth(0.5pt),light=currentlight);
//draw(shift(myx*X+myy*Y+myz*Z)*scale3(0.05)*unitsphere,lightgray,light=currentlight);
}

\end{asypicture}
\end{document}