Skip to content

Commit 0ce7464

Browse files
authored
CI: Fix Small Issue w/ Langmuir Plots (#3010)
1 parent ddca984 commit 0ce7464

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

Examples/Tests/Langmuir/analysis_langmuir_multi.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,20 +118,22 @@ def get_theoretical_field( field, t ):
118118

119119
# Plot the last field from the loop (Ez at iteration 40)
120120
fig, (ax1, ax2) = plt.subplots(1, 2, dpi = 100)
121-
vmin = min(E_sim.min(), E_th.min())
122-
vmax = max(E_sim.max(), E_th.max())
123-
# First plot
121+
# First plot (slice at y=0)
122+
E_plot = E_sim[:,Ncell[1]//2+1,:]
123+
vmin = E_plot.min()
124+
vmax = E_plot.max()
124125
cax1 = make_axes_locatable(ax1).append_axes('right', size = '5%', pad = '5%')
125-
# Plot slice at y=0
126-
im1 = ax1.imshow(E_sim[:,Ncell[1]//2+1,:], origin = 'lower', extent = edge, vmin = vmin, vmax = vmax)
126+
im1 = ax1.imshow(E_plot, origin = 'lower', extent = edge, vmin = vmin, vmax = vmax)
127127
cb1 = fig.colorbar(im1, cax = cax1)
128128
ax1.set_xlabel(r'$z$')
129129
ax1.set_ylabel(r'$x$')
130130
ax1.set_title(r'$E_z$ (sim)')
131-
# Second plot
131+
# Second plot (slice at y=0)
132+
E_plot = E_th[:,Ncell[1]//2+1,:]
133+
vmin = E_plot.min()
134+
vmax = E_plot.max()
132135
cax2 = make_axes_locatable(ax2).append_axes('right', size = '5%', pad = '5%')
133-
# Plot slice at y=0
134-
im2 = ax2.imshow(E_th[:,Ncell[1]//2+1,:], origin = 'lower', extent = edge, vmin = vmin, vmax = vmax)
136+
im2 = ax2.imshow(E_plot, origin = 'lower', extent = edge, vmin = vmin, vmax = vmax)
135137
cb2 = fig.colorbar(im2, cax = cax2)
136138
ax2.set_xlabel(r'$z$')
137139
ax2.set_ylabel(r'$x$')

Examples/Tests/Langmuir/analysis_langmuir_multi_2d.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,18 @@ def get_theoretical_field( field, t ):
9292

9393
# Plot the last field from the loop (Ez at iteration 40)
9494
fig, (ax1, ax2) = plt.subplots(1, 2, dpi = 100)
95-
vmin = min(E_sim.min(), E_th.min())
96-
vmax = max(E_sim.max(), E_th.max())
9795
# First plot
96+
vmin = E_sim.min()
97+
vmax = E_sim.max()
9898
cax1 = make_axes_locatable(ax1).append_axes('right', size = '5%', pad = '5%')
9999
im1 = ax1.imshow(E_sim, origin = 'lower', extent = edge, vmin = vmin, vmax = vmax)
100100
cb1 = fig.colorbar(im1, cax = cax1)
101101
ax1.set_xlabel(r'$z$')
102102
ax1.set_ylabel(r'$x$')
103103
ax1.set_title(r'$E_z$ (sim)')
104104
# Second plot
105+
vmin = E_th.min()
106+
vmax = E_th.max()
105107
cax2 = make_axes_locatable(ax2).append_axes('right', size = '5%', pad = '5%')
106108
im2 = ax2.imshow(E_th, origin = 'lower', extent = edge, vmin = vmin, vmax = vmax)
107109
cb2 = fig.colorbar(im2, cax = cax2)

0 commit comments

Comments
 (0)