<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def apply_plot_params(plot_params,ax):
 """Apply parameters to current axis."""

    
    import matplotlib.pyplot as plt

    if plot_params['xlim'] is not None: 
        ax.set_xlim(plot_params['xlim'])
        
        if plot_params['reverse_x'] and plot_params['xlim'][0] < plot_params['xlim'][1]:
            ax.invert_xaxis()            
            
    elif plot_params['reverse_x']:
        ax.invert_xaxis()
    
    if plot_params['ylim'] is not None: ax.set_ylim(plot_params['ylim'])
        
    ax.grid(plot_params['grid'])
    ax.set_title(plot_params['title'],fontsize=plot_params['fontsize'],y=1.02)
    ax.set_xlabel(plot_params['xlabel'],fontsize=plot_params['tick_fontsize'])
    ax.set_ylabel(plot_params['ylabel'],fontsize=plot_params['tick_fontsize'])
    ax.set_axis_bgcolor(plot_params['axis_bg_color'])
    
    # Apply some properties to the line(s)
    line_handles = ax.get_lines()
    plt.setp(line_handles, lw=plot_params['line_width'], ls=plot_params['line_style'],
             marker=plot_params['marker'])
    
    if plot_params['line_color'] is not 'default':
        plt.setp(line_handles,'color', plot_params['line_color'])

    
    # Autoscale data on the y-axis to reflect changes to the x-axis
    if plot_params['autoscale_y']:
        ax = autoscale_y(ax,margin=0.05)
    
    if plot_params['use_sci_format_yaxis']:
        # Use scientific notation for the y-axis labels
        ax.ticklabel_format(axis='y',style='sci',scilimits=(-2,2))
    
    if plot_params['use_sci_format_xaxis']:
        # Use scientific notation for the x-axis labels
        ax.ticklabel_format(axis='x',style='sci',scilimits=(-2,2))
    
    ax.tick_params(labelsize=plot_params['tick_fontsize'])
        
    return ax