Python: changing axes length
<p><a href="http://i.stack.imgur.com/XoQ8j.png" rel="nofollow">plot of electric field</a><a href="http://i.stack.imgur.com/eXNMH.png" rel="nofollow">plot of electron phase space distribution</a></p>

<p>I am new to Python, I have this script to generate the plots attached, </p>

<pre><code>fig = plt.figure(figsize=(9,3.0))
ax = fig.add_subplot(111)
mul = 1e-2 * m0 * c * wpe / q0
im = ax.pcolormesh(X,Y,dat.Electric_Field_Ex.data[sx,sy]/mul)
plt.yticks(np.arange(np.min(Y), np.max(Y)+1, 2.0))
plt.xlabel("X-Position")
plt.ylabel("Y-Position")

divider = make_axes_locatable(ax)
cax = divider.append_axes("right", size="5%", pad=0.2)
cbar = plt.colorbar(im, cax=cax)
cbar.set_ticks(np.arange(-1, 4, 1))
ax.set_xlim([-x0,x0])
[enter image description here][1]plt.savefig('ex.png',dpi=300,bbox_inches='tight')
</code></pre>

<p>I want to make the x axis longer e.g. from -5 to 5? How do I do this?</p>

<p>Any help would be greatly appreciated...thanks</p>