Edit and compile if you like:
% Author: Izaak Neutelings (March 2020)\documentclass[border=3pt,tikz]{standalone}\usepackage{amsmath} % for \dfrac\usepackage{mathabx} % for \Earth\usepackage{bm} % \bm\usepackage{physics}\usepackage{tikz,pgfplots}\usepackage[outline]{contour} % glow around text\usetikzlibrary{angles,quotes} % for pic (angle labels)\usetikzlibrary{calc}\usetikzlibrary{decorations.markings}\tikzset{>=latex} % for LaTeX arrow head\contourlength{1.6pt}\usepackage{xcolor}\colorlet{Bcol}{violet!90}\colorlet{BFcol}{red!60!black}\colorlet{veccol}{green!45!black}\colorlet{Icol}{blue!70!black}\tikzstyle{BField}=[->,very thick,Bcol]\tikzstyle{current}=[->,Icol] %thick,\tikzstyle{force}=[->,very thick,BFcol]\tikzstyle{velocity}=[->,very thick,vcol]\tikzstyle{charge+}=[very thin,draw=black,top color=red!50,bottom color=red!90!black,shading angle=20,circle,inner sep=0.5]\tikzstyle{charge-}=[very thin,draw=black,top color=blue!50,bottom color=blue!80,shading angle=20,circle,inner sep=0.5]\tikzstyle{vector}=[->,thick,veccol]\tikzset{BFieldLine/.style={thick,Bcol,decoration={markings,mark=at position #1 with {\arrow{latex}}},postaction={decorate}},BFieldLine/.default=0.5,pics/Bin/.style={code={\def\R{0.12}\draw[pic actions,Bcol,line width=0.6] % ,thick(0,0) circle (\R) (-135:.7*\R) -- (45:.7*\R) (-45:.7*\R) -- (135:.7*\R);}},}\begin{document}
Click to download: magnetic_field.tex • magnetic_field.pdf
Open in Overleaf: magnetic_field.tex