def plot_ts(ts_df, plot_title, eventDates, eventLabels=None, save_file_name
    =None, xLabel=None, yLabel=None, show=False):
    """Function to plot the time series data. """
    ax = ts_df.plot(title=plot_title, marker='*', markerfacecolor='red',
        markersize=10, linestyle='solid')
    colors = ['r', 'g', 'c', 'm', 'y', 'b', 'k']
    if not eventLabels:
        for eventDate in eventDates:
            ax.axvline(eventDate, color='r', linestyle='--', lw=2)
    else:
        for idx in range(len(eventDates)):
            ax.axvline(eventDates[idx], color=colors[idx], linestyle='--',
                lw=2, label=eventLabels[idx])
            ax.legend()
    if xLabel:
        ax.set_xlabel(xLabel, fontweight='bold')
    if yLabel:
        ax.set_ylabel(yLabel, fontweight='bold')
    fig = ax.get_figure()
    if save_file_name:
        fig.savefig(save_file_name, bbox_inches='tight')
    if show:
        fig.show()
