Fix position of legend in graph