# pegue este código al final de VectorFieldPlot 1.2 doc = FieldplotDocument ( 'VFPt_dipole_magnetic3' , commons = True , width = 600 , height = 600 ) field = Field ({ 'ringcurrents' : [[ 0 , 0 , 0 , 0.5 , 1 ]]}) n = 12 para i en el rango ( n ): a = 4.2 * ((i + 0.5 ) / n - 0.5 ) línea = FieldLine ( campo , [ 0 , 0.5 * ( exp ( a ) - 1 ) / ( exp ( a ) + 1 )], direcciones = 'ambos' ) doc . dibujar_línea ( línea , ancho de línea = 2.4 , estilo_flechas = { 'dist': 1.7 , 'escala' : 1.1 , 'max_arrows' : 4 }) # dibujar anillo symb = doc . draw_object ( 'g' , { 'id' : 'ring' , 'transform' : 'scale ( {0} , {0} )' . format ( 1.0 / doc . unit )}) defs = doc . draw_object ( 'defs' , {}, group = symb ) spot = doc . draw_object ( 'radialGradient' , {'id' : 'light_spot' , 'cx' : '0.65' , 'cy' : '0.7' , 'r' : '0.75' }, group = defs ) para col , de en [[ '#fff' , ' 0 ' ], [ ' #ddd ' , ' 0.15 ' ], [ ' #aaa ' , ' 0.5 ' ], [ ' # 444 ' , ' 1 ' ]]: doc .draw_object ( 'detener' , { 'detener-color': col , 'offset' : of }, group = spot ) doc . dibujar_objeto ( 'ruta' , { 'd' : 'M -20.5,50 V -50 A 20.5,20.5 0 0,1 20.5, -50 V 50 A 20.5,20.5 0 0,1 -20.5,50 Z' , ' style ' : ' fill: url (#light_spot); stroke: # 000000; stroke-width: 3 ' }, group = symb ) doc . dibujar_objeto ( 'círculo' , { 'cx' : '0' , 'cy' : '0', 'r': '5' , 'transform' : 'translate (0,50)' , 'style' : 'fill: # 000000; accidente cerebrovascular: ninguno; opacidad: 0.5 ' }, grupo = simb ) doc . draw_object ( 'ruta' , { 'd' : 'M {1} , - {0} L {0} , - {1} L {2} , {3} L {0} , {1} \ L {1 } , {0} {3} , {2} L - {1} , {0} L - {0} , {1} L - {2} , {3} L - {0} , - {1} L - {1} , - {0} \ L {3} , - {2 } L {1} , - {0} Z ' . formato ( 11 , 8 , 3 , 0 ), 'transformar' : 'traducir (0, -50)' , 'estilo' : 'llenar: # 000000; accidente cerebrovascular: ninguno; opacidad: 0.5 ' }, grupo = simb ) doc . escribir ()