def plot_varind_gridsearch_magbin_results(gridsearch_results):
<EOL>if (isinstance(gridsearch_results, str) and<EOL>os.path.exists(gridsearch_results)):<EOL><INDENT>with open(gridsearch_results,'<STR_LIT:rb>') as infd:<EOL><INDENT>gridresults = pickle.load(infd)<EOL><DEDENT><DEDENT>elif isinstance(gridsearch_results, dict):<EOL><INDENT>gridresults = gridsearch_results<EOL><DEDENT>else:<EOL><INDENT>LOGERROR('<STR_LIT>'<EOL>'<STR_LIT>')<EOL>return None<EOL><DEDENT>plotres = {'<STR_LIT>':gridresults['<STR_LIT>']}<EOL>recgrid = gridresults['<STR_LIT>']<EOL>simbasedir = gridresults['<STR_LIT>']<EOL>for magcol in gridresults['<STR_LIT>']:<EOL><INDENT>plotres[magcol] = {'<STR_LIT>':[],<EOL>'<STR_LIT>':[],<EOL>'<STR_LIT>':[],<EOL>'<STR_LIT>':gridresults['<STR_LIT>']}<EOL>for magbinind, magbinmedian in enumerate(gridresults['<STR_LIT>']):<EOL><INDENT>LOGINFO('<STR_LIT>' %<EOL>(magcol, magbinmedian))<EOL>stet_mcc = np.array(<EOL>[x[magcol]['<STR_LIT>']<EOL>for x in recgrid[magbinind]]<EOL>)[::(gridresults['<STR_LIT>'].size *<EOL>gridresults['<STR_LIT>'].size)]<EOL>stet_precision = np.array(<EOL>[x[magcol]['<STR_LIT>']<EOL>for x in recgrid[magbinind]]<EOL>)[::(gridresults['<STR_LIT>'].size *<EOL>gridresults['<STR_LIT>'].size)]<EOL>stet_recall = np.array(<EOL>[x[magcol]['<STR_LIT>']<EOL>for x in recgrid[magbinind]]<EOL>)[::(gridresults['<STR_LIT>'].size *<EOL>gridresults['<STR_LIT>'].size)]<EOL>stet_missed_inveta_found = np.array(<EOL>[x[magcol]['<STR_LIT>']<EOL>for x in recgrid[magbinind]]<EOL>)[::(gridresults['<STR_LIT>'].size *<EOL>gridresults['<STR_LIT>'].size)]<EOL>stet_missed_iqr_found = np.array(<EOL>[x[magcol]['<STR_LIT>']<EOL>for x in recgrid[magbinind]]<EOL>)[::(gridresults['<STR_LIT>'].size *<EOL>gridresults['<STR_LIT>'].size)]<EOL>inveta_mcc = np.array(<EOL>[x[magcol]['<STR_LIT>']<EOL>for x in recgrid[magbinind]]<EOL>)[:(gridresults['<STR_LIT>'].size *<EOL>gridresults['<STR_LIT>'].size)][<EOL>::gridresults['<STR_LIT>'].size<EOL>]<EOL>inveta_precision = np.array(<EOL>[x[magcol]['<STR_LIT>']<EOL>for x in recgrid[magbinind]]<EOL>)[:(gridresults['<STR_LIT>'].size *<EOL>gridresults['<STR_LIT>'].size)][<EOL>::gridresults['<STR_LIT>'].size<EOL>]<EOL>inveta_recall = np.array(<EOL>[x[magcol]['<STR_LIT>']<EOL>for x in recgrid[magbinind]]<EOL>)[:(gridresults['<STR_LIT>'].size *<EOL>gridresults['<STR_LIT>'].size)][<EOL>::gridresults['<STR_LIT>'].size<EOL>]<EOL>inveta_missed_stet_found = np.array(<EOL>[x[magcol]['<STR_LIT>']<EOL>for x in recgrid[magbinind]]<EOL>)[:(gridresults['<STR_LIT>'].size *<EOL>gridresults['<STR_LIT>'].size)][<EOL>::gridresults['<STR_LIT>'].size<EOL>]<EOL>inveta_missed_iqr_found = np.array(<EOL>[x[magcol]['<STR_LIT>']<EOL>for x in recgrid[magbinind]]<EOL>)[:(gridresults['<STR_LIT>'].size *<EOL>gridresults['<STR_LIT>'].size)][<EOL>::gridresults['<STR_LIT>'].size<EOL>]<EOL>iqr_mcc = np.array(<EOL>[x[magcol]['<STR_LIT>']<EOL>for x in recgrid[magbinind]]<EOL>)[:(gridresults['<STR_LIT>'].size *<EOL>gridresults['<STR_LIT>'].size)][<EOL>:gridresults['<STR_LIT>'].size<EOL>]<EOL>iqr_precision = np.array(<EOL>[x[magcol]['<STR_LIT>']<EOL>for x in recgrid[magbinind]]<EOL>)[:(gridresults['<STR_LIT>'].size *<EOL>gridresults['<STR_LIT>'].size)][<EOL>:gridresults['<STR_LIT>'].size<EOL>]<EOL>iqr_recall = np.array(<EOL>[x[magcol]['<STR_LIT>']<EOL>for x in recgrid[magbinind]]<EOL>)[:(gridresults['<STR_LIT>'].size *<EOL>gridresults['<STR_LIT>'].size)][<EOL>:gridresults['<STR_LIT>'].size<EOL>]<EOL>iqr_missed_stet_found = np.array(<EOL>[x[magcol]['<STR_LIT>']<EOL>for x in recgrid[magbinind]]<EOL>)[:(gridresults['<STR_LIT>'].size *<EOL>gridresults['<STR_LIT>'].size)][<EOL>:gridresults['<STR_LIT>'].size<EOL>]<EOL>iqr_missed_inveta_found = np.array(<EOL>[x[magcol]['<STR_LIT>']<EOL>for x in recgrid[magbinind]]<EOL>)[:(gridresults['<STR_LIT>'].size *<EOL>gridresults['<STR_LIT>'].size)][<EOL>:gridresults['<STR_LIT>'].size<EOL>]<EOL>fig = plt.figure(figsize=(<NUM_LIT>*<NUM_LIT:5>, <NUM_LIT>*<NUM_LIT:3>))<EOL>plt.subplot(<NUM_LIT:3>,<NUM_LIT:5>,<NUM_LIT:1>)<EOL>if np.any(np.isfinite(stet_mcc)):<EOL><INDENT>plt.plot(gridresults['<STR_LIT>'],<EOL>stet_mcc)<EOL>plt.xlabel('<STR_LIT>')<EOL>plt.ylabel('<STR_LIT>')<EOL>plt.title('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>plt.text(<NUM_LIT:0.5>,<NUM_LIT:0.5>,<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>transform=plt.gca().transAxes,<EOL>horizontalalignment='<STR_LIT>',<EOL>verticalalignment='<STR_LIT>')<EOL>plt.xticks([])<EOL>plt.yticks([])<EOL><DEDENT>plt.subplot(<NUM_LIT:3>,<NUM_LIT:5>,<NUM_LIT:2>)<EOL>if np.any(np.isfinite(stet_precision)):<EOL><INDENT>plt.plot(gridresults['<STR_LIT>'],<EOL>stet_precision)<EOL>plt.xlabel('<STR_LIT>')<EOL>plt.ylabel('<STR_LIT>')<EOL>plt.title('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>plt.text(<NUM_LIT:0.5>,<NUM_LIT:0.5>,<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>transform=plt.gca().transAxes,<EOL>horizontalalignment='<STR_LIT>',<EOL>verticalalignment='<STR_LIT>')<EOL>plt.xticks([])<EOL>plt.yticks([])<EOL><DEDENT>plt.subplot(<NUM_LIT:3>,<NUM_LIT:5>,<NUM_LIT:3>)<EOL>if np.any(np.isfinite(stet_recall)):<EOL><INDENT>plt.plot(gridresults['<STR_LIT>'],<EOL>stet_recall)<EOL>plt.xlabel('<STR_LIT>')<EOL>plt.ylabel('<STR_LIT>')<EOL>plt.title('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>plt.text(<NUM_LIT:0.5>,<NUM_LIT:0.5>,<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>transform=plt.gca().transAxes,<EOL>horizontalalignment='<STR_LIT>',<EOL>verticalalignment='<STR_LIT>')<EOL>plt.xticks([])<EOL>plt.yticks([])<EOL><DEDENT>plt.subplot(<NUM_LIT:3>,<NUM_LIT:5>,<NUM_LIT:4>)<EOL>if np.any(np.isfinite(stet_missed_inveta_found)):<EOL><INDENT>plt.plot(gridresults['<STR_LIT>'],<EOL>stet_missed_inveta_found)<EOL>plt.xlabel('<STR_LIT>')<EOL>plt.ylabel('<STR_LIT>')<EOL>plt.title('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>plt.text(<NUM_LIT:0.5>,<NUM_LIT:0.5>,<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>transform=plt.gca().transAxes,<EOL>horizontalalignment='<STR_LIT>',<EOL>verticalalignment='<STR_LIT>')<EOL>plt.xticks([])<EOL>plt.yticks([])<EOL><DEDENT>plt.subplot(<NUM_LIT:3>,<NUM_LIT:5>,<NUM_LIT:5>)<EOL>if np.any(np.isfinite(stet_missed_iqr_found)):<EOL><INDENT>plt.plot(gridresults['<STR_LIT>'],<EOL>stet_missed_iqr_found)<EOL>plt.xlabel('<STR_LIT>')<EOL>plt.ylabel('<STR_LIT>')<EOL>plt.title('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>plt.text(<NUM_LIT:0.5>,<NUM_LIT:0.5>,<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>transform=plt.gca().transAxes,<EOL>horizontalalignment='<STR_LIT>',<EOL>verticalalignment='<STR_LIT>')<EOL>plt.xticks([])<EOL>plt.yticks([])<EOL><DEDENT>plt.subplot(<NUM_LIT:3>,<NUM_LIT:5>,<NUM_LIT:6>)<EOL>if np.any(np.isfinite(inveta_mcc)):<EOL><INDENT>plt.plot(gridresults['<STR_LIT>'],<EOL>inveta_mcc)<EOL>plt.xlabel('<STR_LIT>')<EOL>plt.ylabel('<STR_LIT>')<EOL>plt.title('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>plt.text(<NUM_LIT:0.5>,<NUM_LIT:0.5>,<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>transform=plt.gca().transAxes,<EOL>horizontalalignment='<STR_LIT>',<EOL>verticalalignment='<STR_LIT>')<EOL>plt.xticks([])<EOL>plt.yticks([])<EOL><DEDENT>plt.subplot(<NUM_LIT:3>,<NUM_LIT:5>,<NUM_LIT:7>)<EOL>if np.any(np.isfinite(inveta_precision)):<EOL><INDENT>plt.plot(gridresults['<STR_LIT>'],<EOL>inveta_precision)<EOL>plt.xlabel('<STR_LIT>')<EOL>plt.ylabel('<STR_LIT>')<EOL>plt.title('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>plt.text(<NUM_LIT:0.5>,<NUM_LIT:0.5>,<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>transform=plt.gca().transAxes,<EOL>horizontalalignment='<STR_LIT>',<EOL>verticalalignment='<STR_LIT>')<EOL>plt.xticks([])<EOL>plt.yticks([])<EOL><DEDENT>plt.subplot(<NUM_LIT:3>,<NUM_LIT:5>,<NUM_LIT:8>)<EOL>if np.any(np.isfinite(inveta_recall)):<EOL><INDENT>plt.plot(gridresults['<STR_LIT>'],<EOL>inveta_recall)<EOL>plt.xlabel('<STR_LIT>')<EOL>plt.ylabel('<STR_LIT>')<EOL>plt.title('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>plt.text(<NUM_LIT:0.5>,<NUM_LIT:0.5>,<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>transform=plt.gca().transAxes,<EOL>horizontalalignment='<STR_LIT>',<EOL>verticalalignment='<STR_LIT>')<EOL>plt.xticks([])<EOL>plt.yticks([])<EOL><DEDENT>plt.subplot(<NUM_LIT:3>,<NUM_LIT:5>,<NUM_LIT:9>)<EOL>if np.any(np.isfinite(inveta_missed_stet_found)):<EOL><INDENT>plt.plot(gridresults['<STR_LIT>'],<EOL>inveta_missed_stet_found)<EOL>plt.xlabel('<STR_LIT>')<EOL>plt.ylabel('<STR_LIT>')<EOL>plt.title('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>plt.text(<NUM_LIT:0.5>,<NUM_LIT:0.5>,<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>transform=plt.gca().transAxes,<EOL>horizontalalignment='<STR_LIT>',<EOL>verticalalignment='<STR_LIT>')<EOL>plt.xticks([])<EOL>plt.yticks([])<EOL><DEDENT>plt.subplot(<NUM_LIT:3>,<NUM_LIT:5>,<NUM_LIT:10>)<EOL>if np.any(np.isfinite(inveta_missed_iqr_found)):<EOL><INDENT>plt.plot(gridresults['<STR_LIT>'],<EOL>inveta_missed_iqr_found)<EOL>plt.xlabel('<STR_LIT>')<EOL>plt.ylabel('<STR_LIT>')<EOL>plt.title('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>plt.text(<NUM_LIT:0.5>,<NUM_LIT:0.5>,<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>transform=plt.gca().transAxes,<EOL>horizontalalignment='<STR_LIT>',<EOL>verticalalignment='<STR_LIT>')<EOL>plt.xticks([])<EOL>plt.yticks([])<EOL><DEDENT>plt.subplot(<NUM_LIT:3>,<NUM_LIT:5>,<NUM_LIT:11>)<EOL>if np.any(np.isfinite(iqr_mcc)):<EOL><INDENT>plt.plot(gridresults['<STR_LIT>'],<EOL>iqr_mcc)<EOL>plt.xlabel('<STR_LIT>')<EOL>plt.ylabel('<STR_LIT>')<EOL>plt.title('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>plt.text(<NUM_LIT:0.5>,<NUM_LIT:0.5>,<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>transform=plt.gca().transAxes,<EOL>horizontalalignment='<STR_LIT>',<EOL>verticalalignment='<STR_LIT>')<EOL>plt.xticks([])<EOL>plt.yticks([])<EOL><DEDENT>plt.subplot(<NUM_LIT:3>,<NUM_LIT:5>,<NUM_LIT:12>)<EOL>if np.any(np.isfinite(iqr_precision)):<EOL><INDENT>plt.plot(gridresults['<STR_LIT>'],<EOL>iqr_precision)<EOL>plt.xlabel('<STR_LIT>')<EOL>plt.ylabel('<STR_LIT>')<EOL>plt.title('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>plt.text(<NUM_LIT:0.5>,<NUM_LIT:0.5>,<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>transform=plt.gca().transAxes,<EOL>horizontalalignment='<STR_LIT>',<EOL>verticalalignment='<STR_LIT>')<EOL>plt.xticks([])<EOL>plt.yticks([])<EOL><DEDENT>plt.subplot(<NUM_LIT:3>,<NUM_LIT:5>,<NUM_LIT>)<EOL>if np.any(np.isfinite(iqr_recall)):<EOL><INDENT>plt.plot(gridresults['<STR_LIT>'],<EOL>iqr_recall)<EOL>plt.xlabel('<STR_LIT>')<EOL>plt.ylabel('<STR_LIT>')<EOL>plt.title('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>plt.text(<NUM_LIT:0.5>,<NUM_LIT:0.5>,<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>transform=plt.gca().transAxes,<EOL>horizontalalignment='<STR_LIT>',<EOL>verticalalignment='<STR_LIT>')<EOL>plt.xticks([])<EOL>plt.yticks([])<EOL><DEDENT>plt.subplot(<NUM_LIT:3>,<NUM_LIT:5>,<NUM_LIT>)<EOL>if np.any(np.isfinite(iqr_missed_stet_found)):<EOL><INDENT>plt.plot(gridresults['<STR_LIT>'],<EOL>iqr_missed_stet_found)<EOL>plt.xlabel('<STR_LIT>')<EOL>plt.ylabel('<STR_LIT>')<EOL>plt.title('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>plt.text(<NUM_LIT:0.5>,<NUM_LIT:0.5>,<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>transform=plt.gca().transAxes,<EOL>horizontalalignment='<STR_LIT>',<EOL>verticalalignment='<STR_LIT>')<EOL>plt.xticks([])<EOL>plt.yticks([])<EOL><DEDENT>plt.subplot(<NUM_LIT:3>,<NUM_LIT:5>,<NUM_LIT:15>)<EOL>if np.any(np.isfinite(iqr_missed_inveta_found)):<EOL><INDENT>plt.plot(gridresults['<STR_LIT>'],<EOL>iqr_missed_inveta_found)<EOL>plt.xlabel('<STR_LIT>')<EOL>plt.ylabel('<STR_LIT>')<EOL>plt.title('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>plt.text(<NUM_LIT:0.5>,<NUM_LIT:0.5>,<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>transform=plt.gca().transAxes,<EOL>horizontalalignment='<STR_LIT>',<EOL>verticalalignment='<STR_LIT>')<EOL>plt.xticks([])<EOL>plt.yticks([])<EOL><DEDENT>plt.subplots_adjust(hspace=<NUM_LIT>,wspace=<NUM_LIT>)<EOL>plt.suptitle('<STR_LIT>' % (magcol, magbinmedian))<EOL>plotdir = os.path.join(gridresults['<STR_LIT>'],<EOL>'<STR_LIT>')<EOL>if not os.path.exists(plotdir):<EOL><INDENT>os.mkdir(plotdir)<EOL><DEDENT>gridplotf = os.path.join(<EOL>plotdir,<EOL>'<STR_LIT>' %<EOL>(magcol, magbinmedian)<EOL>)<EOL>plt.savefig(gridplotf,dpi=<NUM_LIT:100>,bbox_inches='<STR_LIT>')<EOL>plt.close('<STR_LIT:all>')<EOL>stet_mcc_maxind = np.where(stet_mcc == np.max(stet_mcc))<EOL>stet_precision_maxind = np.where(<EOL>stet_precision == np.max(stet_precision)<EOL>)<EOL>stet_recall_maxind = np.where(stet_recall == np.max(stet_recall))<EOL>best_stet_mcc = stet_mcc[stet_mcc_maxind]<EOL>best_stet_precision = stet_mcc[stet_precision_maxind]<EOL>best_stet_recall = stet_mcc[stet_recall_maxind]<EOL>stet_with_best_mcc = gridresults['<STR_LIT>'][stet_mcc_maxind]<EOL>stet_with_best_precision = gridresults['<STR_LIT>'][<EOL>stet_precision_maxind<EOL>]<EOL>stet_with_best_recall = (<EOL>gridresults['<STR_LIT>'][stet_recall_maxind]<EOL>)<EOL>inveta_mcc_maxind = np.where(inveta_mcc == np.max(inveta_mcc))<EOL>inveta_precision_maxind = np.where(<EOL>inveta_precision == np.max(inveta_precision)<EOL>)<EOL>inveta_recall_maxind = (<EOL>np.where(inveta_recall == np.max(inveta_recall))<EOL>)<EOL>best_inveta_mcc = inveta_mcc[inveta_mcc_maxind]<EOL>best_inveta_precision = inveta_mcc[inveta_precision_maxind]<EOL>best_inveta_recall = inveta_mcc[inveta_recall_maxind]<EOL>inveta_with_best_mcc = gridresults['<STR_LIT>'][inveta_mcc_maxind]<EOL>inveta_with_best_precision = gridresults['<STR_LIT>'][<EOL>inveta_precision_maxind<EOL>]<EOL>inveta_with_best_recall = gridresults['<STR_LIT>'][<EOL>inveta_recall_maxind<EOL>]<EOL>iqr_mcc_maxind = np.where(iqr_mcc == np.max(iqr_mcc))<EOL>iqr_precision_maxind = np.where(<EOL>iqr_precision == np.max(iqr_precision)<EOL>)<EOL>iqr_recall_maxind = (<EOL>np.where(iqr_recall == np.max(iqr_recall))<EOL>)<EOL>best_iqr_mcc = iqr_mcc[iqr_mcc_maxind]<EOL>best_iqr_precision = iqr_mcc[iqr_precision_maxind]<EOL>best_iqr_recall = iqr_mcc[iqr_recall_maxind]<EOL>iqr_with_best_mcc = gridresults['<STR_LIT>'][iqr_mcc_maxind]<EOL>iqr_with_best_precision = gridresults['<STR_LIT>'][<EOL>iqr_precision_maxind<EOL>]<EOL>iqr_with_best_recall = gridresults['<STR_LIT>'][<EOL>iqr_recall_maxind<EOL>]<EOL>plotres[magcol][magbinmedian] = {<EOL>'<STR_LIT>':gridresults['<STR_LIT>'],<EOL>'<STR_LIT>':stet_mcc,<EOL>'<STR_LIT>':stet_precision,<EOL>'<STR_LIT>':stet_recall,<EOL>'<STR_LIT>':stet_missed_inveta_found,<EOL>'<STR_LIT>':best_stet_mcc,<EOL>'<STR_LIT>':stet_with_best_mcc,<EOL>'<STR_LIT>':best_stet_precision,<EOL>'<STR_LIT>':stet_with_best_precision,<EOL>'<STR_LIT>':best_stet_recall,<EOL>'<STR_LIT>':stet_with_best_recall,<EOL>'<STR_LIT>':gridresults['<STR_LIT>'],<EOL>'<STR_LIT>':inveta_mcc,<EOL>'<STR_LIT>':inveta_precision,<EOL>'<STR_LIT>':inveta_recall,<EOL>'<STR_LIT>':inveta_missed_stet_found,<EOL>'<STR_LIT>':best_inveta_mcc,<EOL>'<STR_LIT>':inveta_with_best_mcc,<EOL>'<STR_LIT>':best_inveta_precision,<EOL>'<STR_LIT>':inveta_with_best_precision,<EOL>'<STR_LIT>':best_inveta_recall,<EOL>'<STR_LIT>':inveta_with_best_recall,<EOL>'<STR_LIT>':gridresults['<STR_LIT>'],<EOL>'<STR_LIT>':iqr_mcc,<EOL>'<STR_LIT>':iqr_precision,<EOL>'<STR_LIT>':iqr_recall,<EOL>'<STR_LIT>':iqr_missed_stet_found,<EOL>'<STR_LIT>':best_iqr_mcc,<EOL>'<STR_LIT>':iqr_with_best_mcc,<EOL>'<STR_LIT>':best_iqr_precision,<EOL>'<STR_LIT>':iqr_with_best_precision,<EOL>'<STR_LIT>':best_iqr_recall,<EOL>'<STR_LIT>':iqr_with_best_recall,<EOL>'<STR_LIT>':gridplotf<EOL>}<EOL>if stet_with_best_mcc.size > <NUM_LIT:1>:<EOL><INDENT>plotres[magcol]['<STR_LIT>'].append(stet_with_best_mcc[<NUM_LIT:0>])<EOL><DEDENT>elif stet_with_best_mcc.size > <NUM_LIT:0>:<EOL><INDENT>plotres[magcol]['<STR_LIT>'].append(stet_with_best_mcc[<NUM_LIT:0>])<EOL><DEDENT>else:<EOL><INDENT>plotres[magcol]['<STR_LIT>'].append(np.nan)<EOL><DEDENT>if inveta_with_best_mcc.size > <NUM_LIT:1>:<EOL><INDENT>plotres[magcol]['<STR_LIT>'].append(inveta_with_best_mcc[<NUM_LIT:0>])<EOL><DEDENT>elif inveta_with_best_mcc.size > <NUM_LIT:0>:<EOL><INDENT>plotres[magcol]['<STR_LIT>'].append(inveta_with_best_mcc[<NUM_LIT:0>])<EOL><DEDENT>else:<EOL><INDENT>plotres[magcol]['<STR_LIT>'].append(np.nan)<EOL><DEDENT>if iqr_with_best_mcc.size > <NUM_LIT:1>:<EOL><INDENT>plotres[magcol]['<STR_LIT>'].append(iqr_with_best_mcc[<NUM_LIT:0>])<EOL><DEDENT>elif iqr_with_best_mcc.size > <NUM_LIT:0>:<EOL><INDENT>plotres[magcol]['<STR_LIT>'].append(iqr_with_best_mcc[<NUM_LIT:0>])<EOL><DEDENT>else:<EOL><INDENT>plotres[magcol]['<STR_LIT>'].append(np.nan)<EOL><DEDENT><DEDENT><DEDENT>plotrespicklef = os.path.join(simbasedir,<EOL>'<STR_LIT>')<EOL>with open(plotrespicklef, '<STR_LIT:wb>') as outfd:<EOL><INDENT>pickle.dump(plotres, outfd, pickle.HIGHEST_PROTOCOL)<EOL><DEDENT>for magcol in gridresults['<STR_LIT>']:<EOL><INDENT>LOGINFO('<STR_LIT>' % magcol)<EOL>LOGINFO('<STR_LIT>')<EOL>for magbin, inveta, stet, iqr in zip(<EOL>plotres[magcol]['<STR_LIT>'],<EOL>plotres[magcol]['<STR_LIT>'],<EOL>plotres[magcol]['<STR_LIT>'],<EOL>plotres[magcol]['<STR_LIT>']):<EOL><INDENT>LOGINFO('<STR_LIT>' % (magbin,<EOL>inveta,<EOL>stet,<EOL>iqr))<EOL><DEDENT><DEDENT>return plotres<EOL>
This plots the gridsearch results from `variable_index_gridsearch_magbin`.

    Parameters
    ----------

    gridsearch_results : dict
        This is the dict produced by `variable_index_gridsearch_magbin` above.

    Returns
    -------

    dict
        The returned dict contains filenames of the recovery rate plots made for
        each variability index. These include plots of the precision, recall,
        and Matthews Correlation Coefficient over each magbin and a heatmap of
        these values over the grid points of the variability index stdev values
        arrays used.