graphviz image that use a custom node image that is defined by postscript procedure
dot -Tps -l MyShape.ps useShape.gv -o useShape.ps
%!
/xdef {exch def} bind def
/MyShape {
10 dict begin
/fflag xdef %put on local variable
/sides xdef
aload pop % flat out array
newpath
moveto %first point is initial position
1 1 sides
{
setlinewidth
lineto
} for
closepath
fflag % if shape is filled
{
fill
}
%not filled
{
stroke
}
ifelse
end
} bind def
% [100 100 150 100 150 50 100 50 100 100] 4 true MyShape
% showpage
digraph G {
custom[shape=MyShape, label="Custom Shape"];
custom->everything;
}