Answers for "Python colorbar for circular heatmap"

0

Python colorbar for circular heatmap

gs = gridspec.GridSpec(1, 2,
                       width_ratios=[10,1],
                       )

ax1 = plt.subplot(gs[0], projection="polar", aspect=1.)
ax2 = plt.subplot(gs[1])

t = np.linspace(0.0, 2.0 * np.pi, 360)
r = np.linspace(0,100,200)
rg, tg = np.meshgrid(r,t)
c = rg * np.sin(tg)

im = ax1.pcolormesh(t, r, c.T)
plot.colorbar(im, cax=ax2)
Posted by: Guest on April-30-2021

Python Answers by Framework

Browse Popular Code Answers by Language