auto-adjust margins to fit legend
fix behavior on 'new'