# drawing electrical fields using pstricks

I would like that all the charges has the same colour, but with this code for me it's impossible to make the modify. Could you help me?

This is my code:

\documentclass[margin=10pt]{standalone}
\usepackage{pstricks}
\usepackage{pst-electricfield}
\begin{document}
\begin{pspicture*}(-6,-6)(6,6)
\psframe*[linecolor=white!50](-6,-6)(6,6)
\psgrid[subgriddiv=0,gridcolor=gray,griddots=10]
\psElectricfield[Q={[-1 -2 2][1 2 2][-1 2 -2][1 -2 -2]},linecolor=red]
%\psEquipotential[Q={[-1 -2 2][1 2 2][-1 2 -2][1 -2 -2]},linecolor=blue](-6.1,-6.1)(6.1,6.1)
%\psEquipotential[Q={[-1 -2 2][1 2 2][-1 2 -2][1 -2 -2]},linecolor=green,linewidth=2\pslinewidth,Vmax=0,Vmin=0](-6.1,-6.1)(6.1,6.1)
\end{pspicture*}
\end{document}


I would also add a point A in my pic (see the figure).

that is hardcoded in the .pro file (PostScript). You can modify in the file pst-elektricfield.pro the following lines:

/drawChargeCircle { % qi x y r on the stack
0 360 arc
gsave
%  0 ge {1}{0} ifelse setgray fill
pop 0 0 1 setrgbcolor fill
0 setgray stroke
} def


then the charges are plotted always in blue (R G B). You can change the value to whatever you need.

The dot on a field line can be printed with \psdot[dotscale=3](-5,1.3)

• How can i modify the radious or every charge? thanks i would like to have circles bigger than now. thanks ;) – ryuk May 4 '16 at 21:31
• \psElectricfield[radius=...] – user2478 May 5 '16 at 5:19
• I would like also to draw the bounder of the circles. I would like a bounder black. How can i do the correct modify? I tried with this command \draw [color=black,fill=yellow,fill opacity=0.3] (-1.0,-2.0) circle (0.6cm); but there is an error. Thank you very much! – ryuk May 5 '16 at 5:48
• \draw is not a command of PSTricks. The boundery is by default black. – user2478 May 5 '16 at 6:11