Plot series data from MonitorTimeElapsed output text file.

    Args:
        filename (str): Path to *.series.txt file produced by :obj:`~nnabla.MonitorSeries` class.
        elapsed (bool): If ``True``, it plots the total elapsed time.
        unit (str):
            Time unit chosen from ``'s'``, ``'m'``, ``'h'``, or ``'d'``.
        plot_kwags (dict, optional):
            Keyward arguments passed to :function:`matplotlib.pyplot.plot`.

    Note:
        matplotlib package is required.

def plot_time_elapsed(filename, elapsed=False, unit='s', plot_kwargs=None):
    '''Plot series data from MonitorTimeElapsed output text file.

    Args:
        filename (str): Path to *.series.txt file produced by :obj:`~nnabla.MonitorSeries` class.
        elapsed (bool): If ``True``, it plots the total elapsed time.
        unit (str):
            Time unit chosen from ``'s'``, ``'m'``, ``'h'``, or ``'d'``.
        plot_kwags (dict, optional):
            Keyward arguments passed to :function:`matplotlib.pyplot.plot`.

    Note:
        matplotlib package is required.

    '''
    import matplotlib.pyplot as plt

    if plot_kwargs is None:
        plot_kwargs = {}

    data_column = 3 if elapsed else 1
    data = np.genfromtxt(filename, dtype='i8,f4',
                         usecols=(0, data_column), names=['k', 'v'])
    index = data['k']
    values = data['v']
    if unit == 's':
        pass
    elif unit == 'm':
        values /= 60
    elif unit == 'h':
        values /= 3600
    elif unit == 'd':
        values /= 3600 * 24
    else:
        raise ValueError('The argument `unit` must be chosen from {s|m|h|d}.')
    plt.plot(index, values, **plot_kwargs)