Reorganize graph plotting functions