In [1]:
%matplotlib inline

import numpy as np
from matplotlib import style
import matplotlib.pyplot as plt

color = 'ivory'
t = np.arange(50)
kw = dict(color='darkorange', alpha=0.5, linewidth=3)
linekw = dict(color='silver', alpha=0.5, linewidth=3)
figkw = dict(transparent=True, bbox_inches='tight')
arrowprops = dict(arrowstyle='<->', color='black')

$ A\sin(\omega t + \phi) $


In [2]:
M2 = 2.0 * np.sin(2 * np.pi * t / 12.4206 - 0)
S2 = 0.6 * np.sin(2 * np.pi * t / 12.0000 - np.pi)
N2 = 0.5 * np.sin(2 * np.pi * t / 12.6584 - 1.2*np.pi)

K1 = 0.6 * np.sin(2 * np.pi * t / 23.9344 - np.pi)
O1 = 0.6 * np.sin(2 * np.pi * t / 25.8194 - np.pi)
P1 = 0.6 * np.sin(2 * np.pi * t / 24.0659 - np.pi)

fig, axes = plt.subplots(nrows=7, figsize=(7, 7),
                         sharex=True, sharey=True)
ax0, ax1, ax2, ax3, ax4, ax5, ax6 = axes

ax0.plot(t, M2, **kw)
ax0.axhline(**linekw)
ax0.text(4, 3, "M2", color=color)

ax1.plot(t, S2, **kw)
ax1.axhline(**linekw)
ax1.text(4, 3, "S2", color=color)

ax2.plot(t, N2, **kw)
ax2.axhline(**linekw)
ax2.text(4, 3, "N2", color=color)

ax3.plot(t, K1, **kw)
ax3.axhline(**linekw)
ax3.text(4, 3, "K1", color=color)

ax4.plot(t, O1, **kw)
ax4.axhline(**linekw)
ax4.text(4, 3, "O1", color=color)

ax5.plot(t, P1, **kw)
ax5.axhline(**linekw)
ax5.text(4, 3, "P1", color=color)

ax6.plot(t, M2+N2+S2+O1+K1+P1, **kw)
ax6.axhline(**linekw)
ax6.text(4, 3, "Soma", color=color)

ax6.yaxis.set_ticks(np.arange(-6, 6+2, 2))
ax6.xaxis.set_ticks(np.arange(0, 48+12, 12))

[ax.axis('off') for ax in axes]
fig.savefig("tidal_constituent_sum.svg", **figkw)