def plotExperimentResults()

in analysis/analyze.py [0:0]


def plotExperimentResults(dat, x='query_idx', unit='qid', 
                          column=alt.Undefined, row=alt.Undefined, 
                          normalize_by=None, normalize_by_sqrt=False,
                          base_title="Error"):
    unit = makeListLike(unit)
    dat = normalizeDatBySize(dat, normalize_by=normalize_by, sqrt=normalize_by_sqrt)
    aggdat = aggregateExperimentResults(dat, by=[x, column, row] + unit)
    
    title, yaxis = makePlotLabels(column=column, row=row, normalize_by=normalize_by, normalize_by_sqrt=normalize_by_sqrt)
        
    # make actual plot   
    chart = alt.Chart(filterErrorStats(aggdat)).mark_line().encode(
        x=x,
        y=alt.Y('value', axis=alt.Axis(title=yaxis)), 
        color=alt.Color('variable', scale=alt.Scale(domain=list(color_coding_dict.keys()), range=list(color_coding_dict.values()))),
        #)'color_coding'),
        detail="variable"
    ).facet(column=column, row=row).properties(
        title=title
    )
    
    return (chart, aggdat)