import numpy as np
from matplotlib import pyplot

from sliceplots import plot1d_break_x

uu = np.linspace(0, np.pi, 128)
data = np.cos(uu - 0.5) * np.cos(uu.reshape(-1, 1) - 1.0)

_, ax = pyplot.subplots()

plot1d_break_x(
    ax=ax,
    h_axis=uu,
    v_axis=data[data.shape[0] // 2, :],
    param={
        "xlim_left": (0, 1),
        "xlim_right": (2, 3),
        "xlabel": r"$x$ ($\mu$m)",
        "ylabel": r"$\rho$ (cm${}^{-3}$)",
    },
    slice_opts={"ls": "--", "color": "#d62728"})