guiwitz/microfilm

Color-bar (feature request)

haesleinhuepf opened this issue · 3 comments

Hi @guiwitz ,

would it be "easy" / possible to have a color-bar next to an image? I'm asking because some pyclesperanto-users like that feature and I'm considering to use microfilm more often in similar contexts. It's demonstrated excessively here:
https://haesleinhuepf.github.io/BioImageAnalysisNotebooks/60_data_visualization/parametric_maps.html

It's a very simple implementation in pyclesperanto:
https://github.com/clEsperanto/pyclesperanto_prototype/blob/master/pyclesperanto_prototype/_tier9/_imshow.py#L41

Related discussion:

It might be challenging though with multi-channel images...

Looking forward to hear what you think!

Thanks!
Robert

Hi @haesleinhuepf,

yes I planned to add this feature eventually. The only problem is that adding a colorbar might break quite a lot of the tight arrangements that I designed so that e.g. people can get images without any white border around them. So I think in a first step I'll just add the feature for the specific case where one plots a single channel and a single image, which is your use case and generally a common use case, and I'll think later on how to add this for more complex cases. Does that sound reasonable?

Cheers,
Guillaume

Hi @haesleinhuepf, I added the colorbar feature in master via PR #12. It works simply by passing the show_colorbar=True option or by using the add_colorbar method. You can find an example here: https://guiwitz.github.io/microfilm/notebooks/create_plots.html#colorbar. Let me know if that's sufficient or if you'd need more options!

Hi @guiwitz ,

I just tried and it works like charm! Thanks so much. :-)

Have a great weekend!