Skip to content

Commit 1dd1995

Browse files
authored
Merge pull request #1642 from knutfrode/dev
[run-ex] Updated example to illustrate vertical velocity correction
2 parents f09b7bd + e654e6f commit 1dd1995

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

examples/example_vertical_velocity_correction.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,18 @@
5454
o3.run(duration=timedelta(hours=24), time_step=1800)
5555

5656

57-
plt.subplot(3,1,1)
58-
o.result.z.plot.line(x='time', add_legend=False, color='k')
59-
o2.result.z.plot.line(x='time', add_legend=False, color='r')
60-
o3.result.z.plot.line(x='time', add_legend=False, color='g')
57+
fig = plt.figure(figsize=(10, 10))
58+
gs = fig.add_gridspec(5, 1)
59+
ax1 = fig.add_subplot(gs[0:3, 0])
60+
o.result.z.plot.line(ax=ax1, x='time', add_legend=False, color='k')
61+
o2.result.z.plot.line(ax=ax1, x='time', add_legend=False, color='r')
62+
o3.result.z.plot.line(ax=ax1, x='time', add_legend=False, color='g')
6163
plt.plot([], [], color='k', label='No stretching or correction')
6264
plt.plot([], [], color='r', label='Column stretching')
6365
plt.plot([], [], color='g', label='Vertical velocity correction')
6466
plt.legend()
65-
plt.subplot(3,1,2)
66-
o.result.sea_floor_depth_below_sea_level.plot.line(x='time', add_legend=False, color='k')
67-
plt.subplot(3,1,3)
68-
o.result.upward_sea_water_velocity.plot.line(x='time', add_legend=False, color='k')
67+
ax2 = fig.add_subplot(gs[3, 0])
68+
o.result.sea_floor_depth_below_sea_level.plot.line(ax=ax2, x='time', add_legend=False, color='k')
69+
ax3 = fig.add_subplot(gs[4, 0])
70+
o.result.upward_sea_water_velocity.plot.line(ax=ax3, x='time', add_legend=False, color='k')
6971
plt.show()

0 commit comments

Comments
 (0)