plot of electric fieldplot of electron phase space distribution
I am new to Python, I have this script to generate the plots attached,
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')
I want to make the x axis longer e.g. from -5 to 5? How do I do this?
Any help would be greatly appreciated...thanks