def plot(self, y_axis='attenuation', x_axis='energy',
             logx=False, logy=False,
             mixed=True, all_layers=False, all_elements=False,
             all_isotopes=False, items_to_plot=None,
             time_unit='us', offset_us=0., source_to_detector_m=16.,
             time_resolution_us=0.16, t_start_us=1,
             plotly=False, ax_mpl=None,
             fmt='-', ms='2', lw='1.5', alpha=1):
        # offset delay values is normal 2.99 us with NONE actual MCP delay settings
        """display the transmission or attenuation of compound, element and/or isotopes specified

        Parameters:
        ===========
        :param x_axis: x type for export. Must be either ['energy'|'lambda'|'time'|'number']
        :type x_axis: str
        :param y_axis: y type for export. Must be either ['transmission'|'attenuation'|'sigma'|'sigma_raw'|'miu_per_cm']
        :type y_axis: str
        :param logx: True -> display x in log scale
        :type logx: boolean.
        :param logy: True -> display y in log scale
        :type logy: boolean.
        :param mixed: boolean. True -> display the total of each layer
                               False -> not displayed
        :param all_layers: boolean. True -> display all layers
                                    False -> not displayed
        :param all_elements: boolean. True -> display all elements signal
                                      False -> not displayed
        :param all_isotopes: boolean. True -> display all isotopes signal
                                      False -> not displayed
        :param items_to_plot: array that describes what to plot
            ex:
                [['CoAg','Ag','107-Ag'], ['CoAg']]
            if the dictionary is empty, everything is exported
        :param time_unit: string. Must be either ['s'|'us'|'ns']
               Note: this will be used only when x_axis='time'
        :param offset_us: default: 0
               Note: only used when x_axis='number' or 'time'
        :param source_to_detector_m: Note: this will be used only when x_axis='number' or 'time'
        :param time_resolution_us: Note: this will be used only when x_axis='number'
        :param t_start_us: when is the first acquisition occurred. default: 1
               Note: this will be used only when x_axis='number'
        :param plotly: control to use plotly to display or not.
        :type plotly: bool
        :param ax_mpl: matplotlib.axes to plot against
        :type ax_mpl: matplotlib.axes
        :param fmt: matplotlib.axes.plot kwargs
        :type fmt: str
        :param ms: matplotlib.axes.plot kwargs
        :type ms: float
        :param lw: matplotlib.axes.plot kwargs
        :type lw: float
        :param alpha: matplotlib.axes.plot kwargs
        :type alpha: float

        """
        if x_axis not in x_type_list:
            raise ValueError("Please specify the x-axis type using one from '{}'.".format(x_type_list))
        if time_unit not in time_unit_list:
            raise ValueError("Please specify the time unit using one from '{}'.".format(time_unit_list))
        if y_axis not in y_type_list:
            raise ValueError("Please specify the y-axis type using one from '{}'.".format(y_type_list))
        # figure size
        # plt.figure(figsize=(8, 8))

        # stack from self
        _stack_signal = self.stack_signal
        _stack = self.stack

        _stack_sigma = self.stack_sigma
        _x_axis = self.total_signal['energy_eV']
        x_axis_label = None

        # Creating the matplotlib graph..
        if ax_mpl is None:
            fig_mpl, ax_mpl = plt.subplots()

        """X-axis"""
        # determine values and labels for x-axis with options from
        # 'energy(eV)' & 'lambda(A)' & 'time(us)' & 'image number(#)'
        if x_axis == 'energy':
            x_axis_label = 'Energy (eV)'
        if x_axis == 'lambda':
            x_axis_label = u"Wavelength (\u212B)"
            _x_axis = _utilities.ev_to_angstroms(array=_x_axis)
        if x_axis == 'time':
            if time_unit == 's':
                x_axis_label = 'Time (s)'
                _x_axis = _utilities.ev_to_s(array=_x_axis,
                                             source_to_detector_m=source_to_detector_m,
                                             offset_us=offset_us)
            if time_unit == 'us':
                x_axis_label = 'Time (us)'
                _x_axis = 1e6 * _utilities.ev_to_s(array=_x_axis,
                                                   source_to_detector_m=source_to_detector_m,
                                                   offset_us=offset_us)
            if time_unit == 'ns':
                x_axis_label = 'Time (ns)'
                _x_axis = 1e9 * _utilities.ev_to_s(array=_x_axis,
                                                   source_to_detector_m=source_to_detector_m,
                                                   offset_us=offset_us)
            print("'{}' was obtained with the following:\nsource_to_detector_m={}\noffset_us={}"
                  .format(x_axis_label, source_to_detector_m, offset_us))

        if x_axis == 'number':
            x_axis_label = 'Image number (#)'
            _x_axis = _utilities.ev_to_image_number(array=_x_axis,
                                                    source_to_detector_m=source_to_detector_m,
                                                    offset_us=offset_us,
                                                    time_resolution_us=time_resolution_us,
                                                    t_start_us=t_start_us)
            print("'{}' was obtained with the following:\nsource_to_detector_m={}\noffset_us={}\ntime_resolution_us={}"
                  .format(x_axis_label, source_to_detector_m, offset_us, time_resolution_us))
        if x_axis_label is None:
            raise ValueError("x_axis_label does NOT exist, please check.")

        """Y-axis"""
        # determine to plot transmission or attenuation
        # determine to put transmission or attenuation words for y-axis
        y_axis_tag = y_axis
        if y_axis == 'transmission':
            y_axis_label = 'Neutron Transmission'
        elif y_axis == 'attenuation':
            y_axis_label = 'Neutron Attenuation'
        elif y_axis == 'sigma':
            y_axis_tag = 'sigma_b'
            y_axis_label = 'Cross-section (barns)'
        elif y_axis == 'sigma_raw':
            y_axis_tag = 'sigma_b_raw'
            y_axis_label = 'Cross-section (barns)'
        else:
            y_axis_tag = 'miu_per_cm'
            y_axis_label = "Attenuation coefficient (cm\u207B\u00B9)"

        if y_axis_tag[:5] == 'sigma':
            mixed = False
            all_layers = False
            print("'y_axis='sigma'' is selected. Auto force 'mixed=False', 'all_layers=False'")
            if y_axis_tag[-3:] == 'raw':
                all_elements = False
                print("'y_axis='sigma_raw'' is selected. Auto force 'all_elements=False'")

        if y_axis_tag == 'miu_per_cm':
            mixed = False
            print("'y_axis='miu_per_cm'' is selected. Auto force 'mixed=False'")

        # Plotting begins
        if mixed:
            _y_axis = self.total_signal[y_axis_tag]
            ax_mpl.plot(_x_axis, _y_axis, fmt, ms=ms, lw=lw, alpha=alpha, label="Total")

        if all_layers:
            for _compound in _stack.keys():
                _y_axis = _stack_signal[_compound][y_axis_tag]
                ax_mpl.plot(_x_axis, _y_axis, fmt, ms=ms, lw=lw, alpha=alpha, label=_compound)

        if all_elements:
            for _compound in _stack.keys():
                for _element in _stack[_compound]['elements']:
                    if y_axis_tag[:5] != 'sigma':
                        _y_axis = _stack_signal[_compound][_element][y_axis_tag]
                        ax_mpl.plot(_x_axis, _y_axis, fmt, ms=ms, lw=lw, alpha=alpha,
                                    label="{}/{}".format(_compound, _element))
                    else:
                        _y_axis = _stack_sigma[_compound][_element]['sigma_b']
                        ax_mpl.plot(_x_axis, _y_axis, fmt, ms=ms, lw=lw, alpha=alpha,
                                    label="{}/{}".format(_compound, _element))

        if all_isotopes:
            for _compound in _stack.keys():
                for _element in _stack[_compound]['elements']:
                    for _isotope in _stack[_compound][_element]['isotopes']['list']:
                        if y_axis_tag[:5] != 'sigma':
                            _y_axis = _stack_signal[_compound][_element][_isotope][y_axis_tag]
                            ax_mpl.plot(_x_axis, _y_axis, fmt, ms=ms, lw=lw, alpha=alpha,
                                        label="{}/{}/{}".format(_compound, _element, _isotope))
                        else:
                            _y_axis = _stack_sigma[_compound][_element][_isotope][y_axis_tag]
                            ax_mpl.plot(_x_axis, _y_axis, fmt, ms=ms, lw=lw, alpha=alpha,
                                        label="{}/{}/{}".format(_compound, _element, _isotope))

        """Y-axis for specified items_to_plot"""
        if items_to_plot is not None:
            for _path_to_plot in items_to_plot:
                _path_to_plot = list(_path_to_plot)
                if y_axis_tag[:5] != 'sigma':
                    _live_path = _stack_signal
                else:
                    _len_of_path = len(_path_to_plot)
                    if y_axis_tag[-3:] == 'raw':
                        if _len_of_path < 3:
                            raise ValueError("'y_axis={}' is not supported for layer or element levels '{}'.".format(
                                y_axis_tag, _path_to_plot[-1]))
                    else:
                        if _len_of_path < 2:
                            raise ValueError("'y_axis={}' is not supported for layer level '{}'.".format(
                                y_axis_tag, _path_to_plot[-1]))

                    _live_path = _stack_sigma
                _label = "/".join(_path_to_plot)
                while _path_to_plot:
                    _item = _path_to_plot.pop(0)
                    _live_path = _live_path[_item]
                _y_axis = _live_path[y_axis_tag]
                ax_mpl.plot(_x_axis, _y_axis, fmt, ms=ms, lw=lw, alpha=alpha, label=_label)

        if y_axis_tag[:5] != 'sigma' and y_axis_tag != 'miu_per_cm':
            ax_mpl.set_ylim(-0.01, 1.01)
        if logy is True:
            ax_mpl.set_yscale('log')
        if logx is True:
            ax_mpl.set_xscale('log')
        ax_mpl.set_xlabel(x_axis_label)
        ax_mpl.set_ylabel(y_axis_label)
        if not plotly:
            ax_mpl.legend(loc='best')
            # plt.tight_layout()
            return ax_mpl
        else:
            fig_mpl = ax_mpl.get_figure()
            plotly_fig = tls.mpl_to_plotly(fig_mpl)
            plotly_fig.layout.showlegend = True
            return plotly_fig