getMarginWidth function

Find the margin width necessary to fit text or a legend next to a plot