Skip to content

Commit d8fabb4

Browse files
committed
misc: Noodling
1 parent fb72ca2 commit d8fabb4

3 files changed

Lines changed: 19 additions & 6 deletions

File tree

examples/timestepping/acoustic_superstep_2d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ def acoustic_model(model, step=1, snapshots=1):
224224
ax.set_title(f't = {time[idx]:0.3f}')
225225
idx += 1
226226
if ii > 0:
227-
ax.set_xticks([])
228-
ax.set_yticks([])
227+
ax.set_xticklabels([])
228+
ax.set_yticklabels([])
229229
else:
230230
xticks = ax.get_xticks()
231231
ax.set_xticks(np.array((

examples/timestepping/superstep_1d.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def wave_on_string(step=1):
7575

7676
if __name__ == '__main__':
7777
fig, ax = plt.subplots(1, 1)
78+
fig.set_size_inches(8, 4)
7879
x = np.linspace(0, 1, *shape)
7980
ax.plot(
8081
x, gaussian(x, mu=mu, sigma_sq=sigma_sq),
@@ -88,4 +89,6 @@ def wave_on_string(step=1):
8889
ax.set_xlim(*xlim)
8990
ax.set_ylim(-ylim, ylim)
9091
ax.legend()
92+
93+
fig.savefig('1d_example.png', dpi=300)
9194
plt.show()

examples/timestepping/superstep_2d.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ def ripple_on_pond(step=1, snapshots=1):
8989
# Snapshots
9090
m = 13
9191
fig, axes = plt.subplots(len(k), m)
92+
fig.set_size_inches(16, 5)
93+
9294
for step, ax_row in zip(k, axes, strict=True):
9395
data = ripple_on_pond(step=step, snapshots=m)
9496
idx = 0
@@ -101,14 +103,22 @@ def ripple_on_pond(step=1, snapshots=1):
101103
cmap='seismic'
102104
)
103105
idx += 1
106+
if step == 1:
107+
ax.set_title(f't = {(ii*t1)/(m - 1) :0.3f}')
108+
if ii != 0:
109+
ax.set_yticklabels([])
110+
if ii % 2 == 1:
111+
ax.set_xticklabels([])
104112
else:
105113
ax.remove()
106114
fig.subplots_adjust(
107115
left=0.05,
108-
bottom=0.025,
116+
bottom=0.02,
109117
right=0.99,
110-
top=0.97,
111-
wspace=0.06,
112-
hspace=0.06
118+
top=0.96,
119+
wspace=0.23,
120+
hspace=0.0
113121
)
122+
123+
fig.savefig('2d_example.png', dpi=300)
114124
plt.show()

0 commit comments

Comments
 (0)