Modified top.transAxes and top.get_xticklabels to local variables