---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-26-e909243a21a8> in <module>()
3 scatcolor = ax.scatter(x, y, cmap='inferno')
4 ax.axis([0, xmax, 0, ymax])
----> 5 cb = fig.colorbar(scatcolor, ax=ax)
6 cb.set_label('Count of Instances')
~\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\figure.py in colorbar(self, mappable, cax, ax, use_gridspec, **kw)
1842 cax, kw = cbar.make_axes(ax, **kw)
1843 cax._hold = True
-> 1844 cb = cbar.colorbar_factory(cax, mappable, **kw)
1845
1846 self.sca(current_ax)
~\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\colorbar.py in colorbar_factory(cax, mappable, **kwargs)
1363 cb = ColorbarPatch(cax, mappable, **kwargs)
1364 else:
-> 1365 cb = Colorbar(cax, mappable, **kwargs)
1366
1367 cid = mappable.callbacksSM.connect('changed', cb.on_mappable_changed)
~\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\colorbar.py in __init__(self, ax, mappable, **kw)
916 # Ensure the given mappable's norm has appropriate vmin and vmax set
917 # even if mappable.draw has not yet been called.
--> 918 mappable.autoscale_None()
919
920 self.mappable = mappable
~\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\cm.py in autoscale_None(self)
346 """
347 if self._A is None:
--> 348 raise TypeError('You must first set_array for mappable')
349 self.norm.autoscale_None(self._A)
350 self.changed()
TypeError: You must first set_array for mappable