Closed spatts14 closed 1 week ago
Hi Sara, thanks for using Marsilea. This is expected behavior.
In Chunk
, you need to specify the fill_colors
parameter to have color or colors in the background. Please see Chunk.
By the way, did you change some default matplotlib settings? Because the colorbar for the heatmap is gone.
Thanks for the quick response!
I didn't change anything in the default matplotlib. I also was wondering why that occurred... Additionally, I added the fill_colors but I thought by default I shou ld get color blocks in between the labels and heat map like this
Instead when I add a list of colors to fill_color I get this
order = ["Alveolar_1", "Alveolar_2", "Peribronchial", "Adventitial_1", "Adventitial_2", "Pericytes"]
colors_list = ["#4A90E2", "#F5A623", "#50E3C2", "#9013FE", "#FF6B6B", "#4A4A4A"]
h = ma.Heatmap(df, cmap="Reds", label="Expression", height=3, width=4)
h.group_rows(adata_subset.obs["new_clusters_fibro_extended"])
chunk = mp.Chunk(order, rotation=0, align="center", fill_colors=colors_list)
colors = mp.Colors(adata_subset.obs["new_clusters_fibro_extended"])
h.add_left(colors, size=0.5, pad=0.3)
h.add_left(chunk)
#h.add_bottom(ma.plotter.Labels(df.columns))
h.add_title(f"Expression of genes of interest in fibroblast subsets ({subset} mice)")
h.add_legends()
h.render()
Also I corrected the issue title to remove bug as I think there is something I am not understanding or doing wrong?
I think you are confused with two plotters Colors
and Chunk
, Colors
is to visualize categorical data on each row or column as colors. Chunk
will span multiple rows or columns to serve as a subtitle-like purpose. If you want to visualize continuous data to replace Colors
, please use ColorMesh
.
You can check out the gallery at https://marsilea.readthedocs.io/en/stable/examples/index.html to have an idea on what each plotter does.
Describe the issue
Missing color blocks on chunks
Code for reproduction
Actual outcome
See below (image wouldn't attach)
Expected outcome
I don’t know why Im not seeing the color blocks on the left like the tutorial. I can generate tutorial plots fine so I know it isn't an install bug. Can you please help me understand what Im doing wrong in the syntax?
Additional information
No response
Marsilea Version
import marsilea; print(marsilea.version)