<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def plot_by_gene_and_domain(name, seqs, tax, id2name):
 """ plot insertions for each gene and domain """

    for gene in set([seq[0] for seq in list(seqs.values())]):
        for domain in set([seq[1] for seq in list(seqs.values())]):
            plot_insertions(name, seqs, gene, domain, tax, id2name)