<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def plotallanvar(data, dt, tmax=10, ax=None, **kwargs):
 """Plot Allan variance. Args: data (np.ndarray):
 Input data. dt (float):
 Time between each data. tmax (float):
 Maximum time. ax (matplotlib.axes):
 Axis the figure is plotted on. kwargs (optional):
 Plot options passed to ax.plot(). """

    if ax is None:
        ax = plt.gca()
    tk, allanvar = allan_variance(data, dt, tmax)
    ax.loglog(tk, allanvar, **kwargs)
    ax.set_xlabel('Time [s]')
    ax.set_ylabel('Allan Variance')
    ax.legend()