I am plotting an image and no colorbar is display, even if colorbar should default to True in pl.show().
I am currently using the workaround shown in the code to fix this.
##fromspatialdata.datasetsimportblobsimportspatialdata_plotimportmatplotlib.colorsimportmatplotlib.pyplotaspltsdata=blobs()
sdata['single_channel'] =sdata['blobs_image'].sel(c=slice(0, 0))
sdata.pl.render_images('single_channel').pl.show()
# workaroundax=plt.gca()
data=sdata['single_channel'].valuesnorm=matplotlib.colors.Normalize(vmin=data.min(), vmax=data.max())
mappable=plt.cm.ScalarMappable(cmap='viridis', norm=norm)
plt.colorbar(mappable, ax=ax)
plt.show()
I am plotting an image and no colorbar is display, even if
colorbarshould default toTrueinpl.show().I am currently using the workaround shown in the code to fix this.