def get_asg_plotlabels(g, fxn, reshist, t_ind):
    """
    Assigns labels to the ASG graph g in the given fxn from reshist at time t so that it can be plotted

    Parameters
    ----------
    g : networkx graph
        The graph to get labels for
    fxn : FxnBlock
        Corresponding function block for the graph g
    reshist : dict
        The dict of results history over time (from process.hists() or process.typehist() for the typegraph option)
    t_ind : float
        The time in reshist to update the graph at

    Returns
    -------
    labels : dict
        labels for the graph.
    faultfxns : dict
        functions with faults in them
    degfxns : dict
        functions that are degraded
    degflows : dict
        flows that are degraded
    faultlabels : dict
        names of each fault
    faultedges : dict
        edges with faults in them
    faultedgeflows : dict
        names of flows that are degraded on each edge
    edgelabels : dict
        labels of each edge
    """
    labels={node:node for node in g.nodes}
    fxnname=fxn.name
    rhist = reshist['functions'][fxnname]
    actions = fxn.actions

    faultfxns = []
    degfxns = []
    degflows = []
    faultlabels = {}
    edgelabels=dict()
    for edge in g.edges:
        edgelabels[edge[0],edge[1]]=g.get_edge_data(edge[0],edge[1]).get('name','')
    for action in actions:
        if rhist[action]['numfaults'][t_ind]:
            faultfxns+=[action]
            if type(rhist[action]['faults']) == dict:
                faultlabels[action] = {fault for fault, occ in rhist[action]['faults'].items() if occ[t_ind]}
            else: faultlabels[action] = rhist['faults'][t_ind]
        if not rhist['status'][t_ind]:
            degfxns+=[action]
    flows = [flow for flow in {**fxn.flows, **fxn.internal_flows} if flow in g]
    for flow in flows:
        if flow in rhist and any([v[t_ind]!=1 for v in rhist[flow].values()]):
            degflows+=[flow]
        elif flow in reshist['flows'] and not reshist['flows'][flow][t_ind]==1:
            degflows+=[flow]
    faultedges = [] #[edge for edge in g.edges if any([reshist['flows'][flow][t_ind]==0 for flow in g.edges[edge].keys()])]
    faultedgeflows = {} #{edge:''.join([' ',''.join(flow+' ' for flow in g.edges[edge] if reshist['flows'][flow][t_ind]==0)]) for edge in faultedges}
    return labels, faultfxns, degfxns, degflows, faultlabels, faultedges, faultedgeflows, edgelabels