fixed height of legend function