scverse / spatialdata-plot

Static plotting for spatialdata
BSD 3-Clause "New" or "Revised" License
31 stars 13 forks source link

Discussion: add title to multiple colorbars? #361

Open LucaMarconato opened 1 week ago

LucaMarconato commented 1 week ago
##
from spatialdata.datasets import blobs
import spatialdata_plot
import matplotlib.pyplot as plt

sdata = blobs()
sdata['blobs_polygons']['column'] = 0

(
    sdata.pl.render_images('blobs_image')
    .pl.render_shapes('blobs_circles', color='radius')
    .pl.render_shapes('blobs_polygons', color='column')
    .pl.show()
)
plt.show()

gives image Which looks great! But it may be confusing to know which colorbar refers to what. I would consider one of the following:

  1. we leave it as it is: the user should use different colorbars (e.g. viridis + gray) when plotting multiple elements at the same time, so the ambiguity doesn't exist
  2. we add a title on top of the colorbar to make clear what the colorbar refers to
  3. we show only one colorbar maximum.

I prefer having multiple colorbar, so I'd choose either 1 or 2. @timtreis @Sonja-Stockhaus wdyt?

timtreis commented 1 week ago

Don't like 3) either.

Vaguely related to https://github.com/scverse/spatialdata-plot/pull/349 in which I have to refactor the entire logic anyway. One option would be to add cbar_title to the individual calls