Plotting a single categorical variable works great. This code plots two categorical variables together.
Problems:
fromspatialdata.datasetsimportblobsimportspatialdata_plotimportmatplotlib.pyplotaspltfromnumpy.randomimportdefault_rngRNG=default_rng(0)
sdata=blobs()
sdata['table'].obs['cat0'] =RNG.choice(['A', 'B'], size=len(sdata['table']))
sdata['table'].obs['cat0'] =sdata['table'].obs['cat0'].astype('category')
sdata['table'].obs['cat1'] =RNG.choice(['C', 'D'], size=len(sdata['table']))
sdata['table'].obs['cat1'] =sdata['table'].obs['cat1'].astype('category')
(
sdata
.pl.render_labels("blobs_labels", color='cat0')
.pl.render_labels("blobs_labels", color='cat1')
.pl.show()
)
plt.show()
Plotting a single categorical variable works great. This code plots two categorical variables together.
Problems: