I'm triyng to draw the following vector field

$F(x,y) = \frac{\sqrt{2}x}{\sqrt{x^2 + y^2}} \mathbf{i} + \frac{\sqrt{2}y}{\sqrt{x^2 + y^2}} \mathbf{j}$

using \psVectorfield command. The plot given by Maple is

enter image description here

            \rput(\ix,\iy){\psline[linecolor=red,ArrowInside=->](!\ix\space \iy\space 2 copy Pyth dup 3 1 roll div 3 1 roll div 2 sqrt dup 3 1 roll mul 3 1 roll mul)}

enter image description here

  • Artificial Stupidity, please, see graph above. – Artur Nov 25 '18 at 16:51
  • Yes it is. And a potential function is $\sqrt(2*x^2 + 2*y^2)$. But both graphs do not seem similar... – Artur Nov 25 '18 at 17:12
  • I do not think that this is the gradient field for U = (2x^2 + 2y^2) ^ (1/2). U has a rotational symmetry, which your plot does not have. – user121799 Nov 25 '18 at 17:31
  • Thanks to all for the comments (and graphs). One more additional question: excluding 100 pages pst-plot-doc pdf, where I can find more information (if any) about \psVectorfield command? – Artur Nov 25 '18 at 18:09

Meanwhile a pgfplots alternative.

\addplot3 [blue,-stealth,samples=16,
            u={2*x/pow(x^2 + y^2,1/2)},
            v={2*y/pow(x^2 + y^2,1/2)},
            scale arrows=0.2,
    ] { 1}; % use pow(x^2 + y^2,1/2) if you choose to have a real 3D plot

enter image description here


  \psaxes[ticksize=0 4pt,axesstyle=frame,tickstyle=inner,subticks=20,Ox=-1,Oy=-1](-1,-1)(1,1)

enter image description here

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.