ilia-kats / spatialmuon

0 stars 0 forks source link

Plotting Raster objects with 3 channels #14

Closed LucaMarconato closed 2 years ago

LucaMarconato commented 2 years ago

Right now plotting a raster object with 3 channels sets the first as background and then plots the other two with some alpha. We should either keep this behavior and then add the possibility to plot the object as if it was an image (RGB), either modify the default behavior so that it plots as a RGB when there are 3 channels, and then plots further channels in a a way that makes sense (using alpha).

In any case, when having 4 channels, the user should be given the possibility to plot it as a RGBA plot, but this should not be the default behavior.

Maybe a solution is to keep the current behavior and add a parameter to "plot" called "plot_as_image" (and also "plot_pca").

LucaMarconato commented 2 years ago

Solved by using the parameter method: str in .plot(). The default value of method='auto'makes the plotting of images as rgb(a) by default, while preserving a multi-channel plotting when the number of channels is > 4.