def pct_format(): '''Apply "to_percent" custom format for chart tick labels ''' return ticker.FuncFormatter(to_percent)