Attempting to Create Vector Field Plot of Dipole using Matplotlib
<p>I have been a long-time Mathematica user and I've been in the process of converting various notebooks into python (version 3). For plotting, I've been using matplotlib. I've ran into a snag and I am not sure what's going wrong.</p>

<p>I'm trying to convert the following Mathematica code:</p>

<pre><code>(* simple electric dipole *)
Ex[x_, y_] := (x + 1)/((x + 1)^2 + y^2) - (x - 1)/((x - 1)^2 + y^2)
Ey[x_, y_] := y/((x + 1)^2 + y^2) - y/((x - 1)^2 + y^2)
StreamPlot[{Ex[x, y], Ey[x, y]}, {x, -3.5, 3.5}, {y, -3.5, 3.5}]
</code></pre>

<p>This produces the following figure:</p>

<p><img src="https://imgur.com/R9B54id.jpg" alt="Electric Dipole" title="Expected Dipole Result"></p>

<p>I want to reproduce this using Python code.</p>

<pre><code>from pylab import *
X,Y = meshgrid( arange(-4,4,.2),arange(-4,4,.2) )
Ex = (X + 1)/((X+1)**2 + Y**2) - (X - 1)/((X-1)**2 + Y**2)
Ey = Y/((X+1)**2 + Y**2) - Y/((X-1)**2 + Y**2)
figure()
Q = quiver( Ex, Ey)
l,r,b,t = axis()
dx, dy = r-l, t-b 
axis([l-0.05*dx, r+0.05*dx, b-0.05*dy, t+0.05*dy])
show()
</code></pre>

<p>Produces the following figure:</p>

<p><img src="https://imgur.com/a6Y6HDn.png" alt="FUBAR" title="Not Expected Result"></p>

<p>I'm still learning how to do plotting in python, and I'm a little unsure of how to create a vector field plot. Any insight would be appreciated.</p>