def plot_result(x_p, y_p, y_p_e, smoothed_data, smoothed_data_diff, filename=None):
logging.info('<STR_LIT>')<EOL>plt.close()<EOL>p1 = plt.errorbar(x_p * analysis_configuration['<STR_LIT>'], y_p, yerr=y_p_e, fmt='<STR_LIT:o>')  <EOL>p2, = plt.plot(x_p * analysis_configuration['<STR_LIT>'], smoothed_data, '<STR_LIT>')  <EOL>factor = np.amax(y_p) / np.amin(smoothed_data_diff) * <NUM_LIT><EOL>p3, = plt.plot(x_p * analysis_configuration['<STR_LIT>'], factor * smoothed_data_diff, '<STR_LIT:->', lw=<NUM_LIT:2>)  <EOL>mpv_index = np.argmax(-analysis_utils.smooth_differentiation(x_p, y_p, weigths=<NUM_LIT:1> / y_p_e, order=<NUM_LIT:3>, smoothness=analysis_configuration['<STR_LIT>'], derivation=<NUM_LIT:1>))<EOL>p4, = plt.plot([x_p[mpv_index] * analysis_configuration['<STR_LIT>'], x_p[mpv_index] * analysis_configuration['<STR_LIT>']], [<NUM_LIT:0>, factor * smoothed_data_diff[mpv_index]], '<STR_LIT>', lw=<NUM_LIT:2>)<EOL>text = '<STR_LIT>' + str(int(x_p[mpv_index] * analysis_configuration['<STR_LIT>'])) + '<STR_LIT>'<EOL>plt.text(<NUM_LIT> * x_p[mpv_index] * analysis_configuration['<STR_LIT>'], -<NUM_LIT> * smoothed_data_diff[mpv_index], text, ha='<STR_LIT:left>')<EOL>plt.legend([p1, p2, p3, p4], ['<STR_LIT:data>', '<STR_LIT>', '<STR_LIT>', text], prop={'<STR_LIT:size>': <NUM_LIT:12>}, loc=<NUM_LIT:0>)<EOL>plt.title('<STR_LIT>')<EOL>plt.xlabel('<STR_LIT>')<EOL>plt.ylabel('<STR_LIT>')<EOL>plt.ylim(<NUM_LIT:0>, np.amax(y_p) * <NUM_LIT>)<EOL>if filename is None:<EOL><INDENT>plt.show()<EOL><DEDENT>else:<EOL><INDENT>filename.savefig(plt.gcf())<EOL><DEDENT>return smoothed_data_diff<EOL>
Fit spline to the profile histogramed data, differentiate, determine MPV and plot.
     Parameters
    ----------
        x_p, y_p : array like
            data points (x,y)
        y_p_e : array like
            error bars in y