|
@@ -124,7 +124,7 @@ print "m =", m
|
|
|
|
|
|
npts = 281
|
|
|
|
|
|
-factor=7
|
|
|
+factor=3
|
|
|
scan = np.linspace(-factor*x[0, 0], factor*x[0, 0], npts)
|
|
|
|
|
|
coordX, coordZ = np.meshgrid(scan, scan)
|
|
@@ -159,20 +159,20 @@ try:
|
|
|
|
|
|
|
|
|
|
|
|
- fig, axs = plt.subplots(1, 2)
|
|
|
+ fig, ax = plt.subplots(1, 1)
|
|
|
|
|
|
- idxs = np.where(np.abs(coordX) < 1e-10)
|
|
|
+
|
|
|
|
|
|
- axs[0].errorbar(coordZ[idxs]*WL/2.0/np.pi/nm, P[idxs], fmt = 'r', label = 'Poynting vector')
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- axs[0].errorbar(coordZ[idxs]*WL/2.0/np.pi/nm, H[0, idxs][0, :, 0].real, fmt = 'b', label = 'Px')
|
|
|
- axs[0].errorbar(coordZ[idxs]*WL/2.0/np.pi/nm, H[0, idxs][0, :, 1].real, fmt = 'k', label = 'Py')
|
|
|
- axs[0].errorbar(coordZ[idxs]*WL/2.0/np.pi/nm, H[0, idxs][0, :, 2].real, fmt = 'b', label = 'Pz')
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- axs[0].legend()
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -186,19 +186,19 @@ try:
|
|
|
scale_ticks = np.linspace(min_tick, max_tick, 11)
|
|
|
|
|
|
|
|
|
-
|
|
|
- cax = axs[1].imshow(Eabs_data, interpolation = 'nearest', cmap = cm.jet,
|
|
|
+
|
|
|
+ cax = ax.imshow(Eabs_data, interpolation = 'nearest', cmap = cm.jet,
|
|
|
origin = 'lower'
|
|
|
|
|
|
, extent = (min(scale_x), max(scale_x), min(scale_z), max(scale_z))
|
|
|
|
|
|
)
|
|
|
- axs[1].axis("image")
|
|
|
+ ax.axis("image")
|
|
|
|
|
|
|
|
|
cbar = fig.colorbar(cax, ticks = [a for a in scale_ticks])
|
|
|
cbar.ax.set_yticklabels(['%5.3g' % (a) for a in scale_ticks])
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
plt.xlabel('Z, nm')
|
|
@@ -208,11 +208,11 @@ try:
|
|
|
from matplotlib import patches
|
|
|
s1 = patches.Arc((0, 0), 2.0*core_r, 2.0*core_r, angle=0.0, zorder=2,
|
|
|
theta1=0.0, theta2=360.0, linewidth=1, color='black')
|
|
|
- axs[1].add_patch(s1)
|
|
|
+ ax.add_patch(s1)
|
|
|
|
|
|
from matplotlib.path import Path
|
|
|
|
|
|
- flow_total = 41
|
|
|
+ flow_total = 39
|
|
|
for flow in range(0,flow_total):
|
|
|
flow_x, flow_z = GetFlow(scale_x, scale_z, Ec, Hc,
|
|
|
min(scale_x)+flow*(scale_x[-1]-scale_x[0])/(flow_total-1),
|
|
@@ -225,7 +225,7 @@ try:
|
|
|
codes[0] = Path.MOVETO
|
|
|
path = Path(verts, codes)
|
|
|
patch = patches.PathPatch(path, facecolor='none', lw=1, edgecolor='white')
|
|
|
- axs[1].add_patch(patch)
|
|
|
+ ax.add_patch(patch)
|
|
|
|
|
|
|
|
|
|
|
@@ -239,7 +239,7 @@ try:
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
plt.draw()
|