Fix legend positioning in profile plots