Sort labels when ploting a diagram