adapt labeling in graphs