After D = Poset(( divisors(12), attrcall("divides") )) mb={x:D.mobius_function(x, D.top()) for x in D} labels={x:(x, mb[x]) for x in D} v_colors={"red": [e for e in D if mb[e]>0], "gray": [e for e in D if mb[e]==0], "blue": [e for e in D if mb[e]<0]}
it seems that D.plot(element_labels=labels) and D.plot(vertex_colors=v_colors, vertex_shape="s", vertex_size=2000, figsize=6) works, but D.plot(element_labels=labels, vertex_colors=v_colors, vertex_shape="s", vertex_size=2000, figsize=6) says Traceback (click to the left of this block for traceback) ... KeyError: 4 Why so? -- Jori Mäntysalo