update from master, fix legend clipping