-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Text Labels are not displaying properly #94
Comments
Which version are you using? Can you try the latest version? Or just install from the github: |
I think that could help. I also wanted to ask if you know how to make the diagonal elements of the symmetric matrix have a red border. Using seaborn, it is:
And how to make the legend below the plot. I was looking for any documentation for how to do this using PCH. |
Please check the documentation here (https://dingwb.github.io/PyComplexHeatmap/build/html/notebooks/cpg_modules.html#Plotting-the-Dot-clustermap) about how to plot the red border. |
I have no idea why this happened on your side. Everything is good on my side. |
Please also report the version of Python and matplotlib. |
I'm using matplotlib v3.9.2 and python v3.10.12 I tried upgrading to v1.9.0 of PyComplexHeatmap but it says this distribution cannot be found. Has this version been released yet? |
I found a workaround, but I had to write my code based on PyComplexHeatmap and make some adjustments. I will see how to share that code. |
Hi @jsharrison94 , Thanks for reporting the versions. I can reproduce the issue now. I don't know why matpltolib 3.9.2 has such kind of issue, but I will look into it. |
I just tested different versions of matplotlib, it works for matpltolib <= 3.7.5. I would recommend you install matplotlib 3.7.5. |
I think I have already fixed this. |
I've installed the new version and can confirm this has fixed the issue on my end. Thank you very much for the fast response! |
Hi there, I have tried running the example from https://github.com/DingWB/PyComplexHeatmap/blob/main/notebooks/kwargs.ipynb and I was unable to generate the same plot for the given data. I was seeing how to display the text labels, but it did not work.
Instead, I did not get the labels for all of the cells. This is what I got:
![example_pch](https://private-user-images.githubusercontent.com/5076237/381682095-00f07e45-f66e-4c0c-97f2-593ad1df0d1f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg3Mzc4MzEsIm5iZiI6MTczODczNzUzMSwicGF0aCI6Ii81MDc2MjM3LzM4MTY4MjA5NS0wMGYwN2U0NS1mNjZlLTRjMGMtOTdmMi01OTNhZDFkZjBkMWYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDVUMDYzODUxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjIwMmYzYzQ0ZThjNzJiYjdhZGQ2OTE1MTMzYTFkNzc0NmJhNGM5NzBlMGExMGE0MDkyMmQ1ZGNjMTc3NDA3NCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.P5O1VxgMAZoACMCtcQKslMlHRZAXyhdUxSrTmZ8Dldk)
when I ran
label_kws
inHeatmapAnnotation
control the heatmap annotaiton labelscol_ha = pch.HeatmapAnnotation(
Groups=pch.anno_simple(df.Groups,add_text=True,text_kws={'color':'black'}),
AB=pch.anno_simple(df.AB,add_text=True),axis=1,
Exp=pch.anno_boxplot(df_box, cmap='turbo'),
verbose=0,label_side='right',
)
xticklabels_kws
andyticklabels_kws
control the ticklabels for the heatmap.plt.figure(figsize=(6, 8))
cm = pch.ClusterMapPlotter(data=df_heatmap, top_annotation=col_ha,
col_split=df.Groups, col_split_order="cluster_between_groups",
col_split_gap=0.5,col_cluster=True,
row_cluster=True,col_dendrogram=True,
label='values',show_rownames=True,show_colnames=True,
tree_kws={'colors':'blue'},verbose=0,legend_gap=7,
annot=True,fmt='.1g',linewidths=0.05,linecolor='gold',cmap='RdYlBu_r',
plt.show()
So you can see some incomplete text in cells. I even tried out
df_heatmap = df_heatmap.astype(float)
I have been struggling to create a proper pch heatmap with the values displayed on top. Please tell me how to do this and if this is indeed a bug that can be fixed.
For instance, for my work, this is what I'm uncovering:
when I run this:
plt.figure(figsize=(10, 12))
cm = pch.ClusterMapPlotter(data=conf_matrix, cmap='Reds',annot=True,fmt='.0f',
linewidths=0.5,linecolor='black', col_cluster = False,
row_cluster=False,col_dendrogram=False, row_dendrogram = False,
show_rownames=True,show_colnames=True)
cm
plt.show()
Thanks!
The text was updated successfully, but these errors were encountered: