def _write_comparison_plot_table(spid, models, options, core_results,<EOL>fit_results):
<EOL>is_curve = '<STR_LIT:x>' in core_results[<NUM_LIT:0>][<NUM_LIT:1>]<EOL>df = core_results[spid][<NUM_LIT:1>]<EOL>df.rename(columns={'<STR_LIT:y>': '<STR_LIT>'}, inplace=True)<EOL>if not is_curve:<EOL><INDENT>x = np.arange(len(df)) + <NUM_LIT:1><EOL>df = df.sort(columns='<STR_LIT>')<EOL>df.insert(<NUM_LIT:0>, '<STR_LIT:x>', x[::-<NUM_LIT:1>])<EOL><DEDENT>for model in models:<EOL><INDENT>fit_result = fit_results[spid][model]<EOL>df[model] = fit_result[<NUM_LIT:1>]<EOL>df[model + "<STR_LIT>"] = df[model] - df['<STR_LIT>']<EOL><DEDENT>if is_curve:<EOL><INDENT>df = df.sort(columns='<STR_LIT:x>')<EOL><DEDENT>f_path = _get_file_path(spid, options, '<STR_LIT>')<EOL>p_path = _get_file_path(spid, options, '<STR_LIT>')<EOL>df.to_csv(f_path, index=False, float_format='<STR_LIT>')  <EOL>fig, (ax1, ax2) = plt.subplots(<NUM_LIT:1>, <NUM_LIT:2>)<EOL>ax1.scatter(df['<STR_LIT:x>'], df['<STR_LIT>'], color='<STR_LIT:k>')<EOL>ax1.plot(df['<STR_LIT:x>'], df[models])<EOL>ax1.legend(models + ['<STR_LIT>'], loc='<STR_LIT>')<EOL>ax1.set_xlabel('<STR_LIT:x>')<EOL>ax1.set_ylabel('<STR_LIT:value>')<EOL>ax2.hlines(<NUM_LIT:0>, np.min(df['<STR_LIT:x>']), np.max(df['<STR_LIT:x>']))<EOL>ax2.plot(df['<STR_LIT:x>'], df[[x + '<STR_LIT>' for x in models]])<EOL>ax2.legend(models + ['<STR_LIT>'], loc='<STR_LIT>')<EOL>ax2.set_xlabel('<STR_LIT:x>')<EOL>ax2.set_ylabel('<STR_LIT>')<EOL>ax2.set_xlim(ax1.get_xlim())<EOL>ax2.set_ylim(min(ax2.get_ylim()[<NUM_LIT:0>], -<NUM_LIT:1>), max(ax2.get_ylim()[<NUM_LIT:1>], <NUM_LIT:1>))<EOL>if options.get('<STR_LIT>', None):<EOL><INDENT>ax1.set_yscale('<STR_LIT>')<EOL>ax2.set_yscale('<STR_LIT>', linthreshy=<NUM_LIT:1>)<EOL><DEDENT>if options.get('<STR_LIT>', None):<EOL><INDENT>ax1.set_xscale('<STR_LIT>')<EOL>ax2.set_xscale('<STR_LIT>')<EOL><DEDENT>if not options.get('<STR_LIT>', None) and not options.get('<STR_LIT>', None):<EOL><INDENT>ax1.set_ylim(bottom=<NUM_LIT:0>)<EOL>ax1.set_xlim(left=<NUM_LIT:0>)<EOL>ax1 = _pad_plot_frame(ax1)<EOL>ax2 = _pad_plot_frame(ax2)<EOL><DEDENT>with warnings.catch_warnings():<EOL><INDENT>warnings.simplefilter("<STR_LIT:ignore>")<EOL>fig.tight_layout()<EOL><DEDENT>fig.savefig(p_path)<EOL>plt.close('<STR_LIT:all>')<EOL>
Notes
-----
Only applies to analysis using functions from empirical in which models are
also given.