Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clustergram obscures lengthy row labels with colour scale bar #771

Open
kamurani opened this issue Jul 1, 2024 · 0 comments
Open

Clustergram obscures lengthy row labels with colour scale bar #771

kamurani opened this issue Jul 1, 2024 · 0 comments

Comments

@kamurani
Copy link

kamurani commented Jul 1, 2024

I am using Clustergram figures in a Jupyter notebook. When plotting the clusters calculated from a dataframe, I have some long column / row names that I need to show in the figure as labels.

However, the colour scale bar is not automatically adjusted to move to the right to accommodate the extra space taken up by longer text in the row labels.

To Reproduce

import pandas as pd
import dash_bio
example_df = pd.read_csv('https://git.io/clustergram_brain_cancer.csv').set_index('ID_REF')

# add row names 
row_prefix = "A really long name for a row / column"
example_df.index = [f"{row_prefix} {i}" for i in example_df.index]

fig = dash_bio.Clustergram(
    data=example_df,
    row_labels=list(example_df.index),
)
fig.show()

This gives me:
image

Expected behavior
The plot should detect the sizing of row / column labels, and if there is enough room (which there is in this case), the colour scale bar should position itself outside the range of this text.

Alternatively, there should be a way to disable the colour bar to prevent obscuring the labels (I have been unable to get this working either with Clustergram)

E.g.

fig.update_coloraxes(showscale=False) # this does not remove anything from the `Clustergram` figure. 

Versions

Python 3.12.2

>>>print(dash_bio.__version__)
1.0.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant