Add legend to graphs