import numpy as np
from komorebi_browser import show_plot

x = np.linspace(0, 2*np.pi, 201)
a, b = np.sin(x), 0.5*np.sin(3*x)
show_plot([
    {"x": x, "y": a, "name": "sin(x)", "mode": "lines"},
    {"x": x, "y": b, "name": "0.5 sin(3x)", "mode": "lines"},
    {"x": x, "y": a+b, "name": "Sum", "mode": "lines"},
], {"title": {"text": "Two waves and their sum"},
    "xaxis": {"title": {"text": "x (radians)"}},
    "yaxis": {"title": {"text": "Amplitude"}}},
    description="Two periodic sine waves and their pointwise sum on 0 to 2 pi.")
print("Plotted 201 samples of two waves and their sum.")
