Add axis to colorbar in python matplotlib
<p>I am trying to produce a figure like the following in python:</p>

<p><a href="https://i.stack.imgur.com/ILlZG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ILlZG.jpg" alt="enter image description here"></a></p>

<p>I am done with most part of it and currently based on what I want it looks like this:</p>

<p><a href="https://i.stack.imgur.com/6LzEn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6LzEn.png" alt="enter image description here"></a></p>

<p>And my code is:</p>

<pre><code>plt.scatter(x,y,marker="h",s=100,c=color)
plt.xscale('log')
plt.yscale('log')
plt.xlim([1, 10**3])
plt.ylim([1, 10**3])
plt.colorbar()
plt.show()
</code></pre>

<p>Is there any way to make the current colorbar look like the one on top? So to make it smaller and add axis to it? </p>

<p>Any help would be much appreciated.</p>