In [1]:
%matplotlib inline
import numpy as np
from matplotlib import style
import matplotlib.pyplot as plt
t = np.arange(50)
kw = dict(alpha=0.5, linewidth=3)
figkw = dict(transparent=False, dpi=120, bbox_inches='tight')
arrowprops = dict(arrowstyle='<->', color='black')
In [2]:
K1amp, K1phase = 1.8, 0
diurnal = K1amp * np.sin(2 * np.pi * t / 23.9344 - K1phase)
fig, ax = plt.subplots(figsize=(7, 2.75))
ax.plot(t, diurnal, color='darkorange', **kw)
ax.set_xlim(0, 48)
ax.axhline(color='k', **kw)
ax.set_xlabel('Horas')
ax.set_ylabel('m')
ax.grid(True)
ax.yaxis.set_ticks(np.arange(-4, 4+2, 2))
ax.xaxis.set_ticks(np.arange(0, 48+12, 12))
ax.annotate('', xy=(6, 2), xycoords='data',
xytext=(30, 2), textcoords='data',
arrowprops=arrowprops)
ax.text(18, 2.1, "Período da Maré", ha='center')
ax.annotate('', xy=(6, 3), xycoords='data',
xytext=(30, 3), textcoords='data',
arrowprops=arrowprops)
ax.text(18, 3.1, "Dia da Maré", ha='center')
ax.text(30, -3, "Maré Diurna", ha='center')
fig.savefig("diurnal.png", **figkw)
In [3]:
M2amp, M2phase = 2, 0
S2amp, S2phase = 0.6, np.pi
semidiurnal = M2amp * np.sin(2 * np.pi * t / 12.42 - M2phase)
semidiurnal += S2amp * np.sin(2 * np.pi * t / 12.0 - S2phase)
fig, ax = plt.subplots(figsize=(7, 2.75))
ax.plot(t, semidiurnal, color='darkorange', **kw)
ax.set_xlim(0, 48)
ax.axhline(color='k', **kw)
ax.set_xlabel('Horas')
ax.set_ylabel('m')
ax.grid(True)
ax.yaxis.set_ticks(np.arange(-4, 4+2, 2))
ax.xaxis.set_ticks(np.arange(0, 48+12, 12))
ax.annotate('', xy=(3, 1.8), xycoords='data',
xytext=(15, 1.8), textcoords='data',
arrowprops=arrowprops)
ax.text(9, 2.1, "Período da Maré", ha='center')
ax.annotate('', xy=(3, 3), xycoords='data',
xytext=(27, 3), textcoords='data',
arrowprops=arrowprops)
ax.text(15, 3.1, "Dia da Maré", ha='center')
ax.text(30, -3, "Maré semi-diurna", ha='center')
fig.savefig("semi-diurnal.png", **figkw)
In [4]:
mixed = diurnal + semidiurnal
fig, ax = plt.subplots(figsize=(7, 2.75))
ax.plot(t, mixed, color='darkorange', **kw)
ax.set_xlim(0, 48)
ax.axhline(color='k', **kw)
ax.set_xlabel('Horas')
ax.set_ylabel('m')
ax.grid(True)
ax.yaxis.set_ticks(np.arange(-4, 4+2, 2))
ax.xaxis.set_ticks(np.arange(0, 48+12, 12))
ax.annotate('', xy=(3, 1.8), xycoords='data',
xytext=(15, 1.8), textcoords='data',
arrowprops=arrowprops)
ax.text(9, 2.1, "Período da Maré", ha='center')
ax.annotate('', xy=(3, 3), xycoords='data',
xytext=(27, 3), textcoords='data',
arrowprops=arrowprops)
ax.text(15, 3.1, "Dia da Maré", ha='center')
ax.text(30, -3, "Maré mista", ha='center')
fig.savefig("mixed.png", **figkw)