import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter

def currency(x, pos):
    if x >= 1e6:
        s = '${:1.1f}M'.format(x * 1e-6)
    else:
        s = '${:1.0f}M'.format(x * 1e-3)
    return s
formatter = FuncFormatter(currency)


data = {'Barton LLC': 109438.50,
        'Frami, Hills and Schmidt': 103569.59,
        'Fritsch, Russel and Anderson': 112214.71,
        'Jerde-Hilpert': 112591.43,
        'Keeling LLC': 100934.30,
        'Koepp Ltd': 103660.54,
        'Kulas Inc': 137351.96,
        'Trantow-Barrows': 123381.38,
        'White-Trantow': 135841.99,
        'Will LLC': 104437.60}
group_data = list(data.values())
group_names = list(data.keys())
group_mean = np.mean(group_data)

figure, axes=plt.subplots()
plt.style.use('ggplot')


axes.barh(group_names, group_data)
labels = axes.get_xticklabels()
plt.setp(labels, rotation=45, horizontalalignment='right')
axes.set(xlim=[-10000, 140000],
         xlabel='Total Revenue',
         ylabel='Company',
         title='Company Revenue')

axes.xaxis.set_major_formatter(formatter)
axes.axvline(group_mean, ls='--', color='r')