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

from plot_helpers import CO, bold_ticks


def fig6_13():
    a = 0
    b = 3

    nxe = 4000
    xe = np.linspace(a, b, nxe)
    ye = np.zeros(nxe)
    for ix in range(nxe):
        ye[ix] = f(xe[ix])

    plt.close("all")
    # get(gcf)
    fig, ax = plt.subplots(figsize=(8.8, 3.3))
    fig.subplots_adjust(left=0.09, right=0.98, bottom=0.22, top=0.98)
    ax.set_prop_cycle(cycler(color=CO))

    ax.plot(xe, ye, "b", linewidth=1.6)
    ax.set_xlim(a, b)
    ax.set_ylim(-0.04, 1.04)
    ax.grid(True)
    ax.set_xlabel("x-axis")
    ax.set_ylabel("y-axis")
    bold_ticks(ax, 14)
    plt.show()

    # plt.savefig('/Users/mark/Desktop/sharp.eps')


def f(x):
    y = np.cos(x ** 3) ** 200
    return y


if __name__ == "__main__":
    fig6_13()
