I am trying to format my colorbar such the numbers are formatted with commas. Any help would be greatly appreciated
import numpy as np
import matplotlib.pypl
You can create and specify a custom formatter:
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
comma_fmt = FuncFormatter(lambda x, p: format(int(x), ','))
plt.matshow(np.array(([30000,8000],[12000,25000])))
plt.colorbar(format=comma_fmt)
plt.show()