Comments (5)
I don't think this is an issue when you used a tight layout, if the real legend width of color_dict legend was smaller than the given legend_width=50
, then there would be no influence.
Minor suggestion, you can decrease the width/height of the row/col dendrogram to make the figure looks better.
from pycomplexheatmap.
I have set the tight parameter, I tried setting row_ dendrogram=False, But the legend still has cover。
plt.figure(figsize=(16, 10), dpi=300)
cm = ph.ClusterMapPlotter(
data=df_corr,
label='pearson', show_rownames=False, row_names_side='left', top_annotation=col_ha,left_annotation=row_ha,
show_colnames=True, col_cluster=True, row_cluster=True,
col_dendrogram=True, row_dendrogram=False, row_dendrogram_size=20, col_dendrogram_size=20,legend_width=20,
linewidths=0.001,linecolor='white',
col_split_gap=2, row_split_gap=2)
cm.ax.set_title(f"{prefix}-相关性热图—聚类", y=1.03, fontdict={'fontweight':'bold'})
if debug:
plt.show()
else:
plt.savefig(f"{out_dir}/{prefix}_相关性热图_聚类.png", bbox_inches = 'tight')
from pycomplexheatmap.
Please give me the dataset you used in this example, so that I can debug it.
from pycomplexheatmap.
Please give me the dataset you used in this example, so that I can debug it.
data_frame_in.csv
sample_info.csv
data_frame_in = pd.read_csv("data_frame_in.csv", sep="\t", index_col=0)
sample_info = pd.read_csv('sample_info.csv', sep="\t", index_col=0)
plt.figure(figsize=(16, 10), dpi=300)
col_ha = ph.HeatmapAnnotation(
志愿者=ph.anno_simple(sample_info['志愿者编号'], cmap='Paired'),
类别=ph.anno_simple(sample_info['类别'], cmap='Set1'), wspace=2,
axis=1)
cm = ph.ClusterMapPlotter(
data=data_frame_in,
label='test', show_rownames=False, row_names_side='left', top_annotation=col_ha,
show_colnames=True, col_cluster=True, row_cluster=True,
col_dendrogram=True, row_dendrogram=True, row_dendrogram_size=20, col_dendrogram_size=20,legend_width=20)
cm.ax.set_title("热图—聚类", y=1.03, fontdict={'fontweight':'bold'})
plt.show()
from pycomplexheatmap.
Please give me the dataset you used in this example, so that I can debug it.
sorry, it may my fault(reboot jupyter), now it works fine!
from pycomplexheatmap.
Related Issues (20)
- Possible bug? 'lightgray' is not a valid color value. HOT 9
- Thick white lines appearning in clustermap when large genesets used HOT 3
- Missing annotation HOT 2
- Try to save results from ClusterMapPlotter as pdf, but the heatmap is a figure not in vector HOT 6
- cluster_between_groups and col_split_order: allow custom col_split_order after clustering the groups specified with col_split HOT 10
- MatplotlibDeprecationWarning HOT 1
- optimizing and sorting dendrogram HOT 10
- Unexpected grid potential caused by seaborn or scanpy
- Adjusting width/height of heatmap? HOT 1
- Missing annot when using composite HOT 1
- Centering custom annotation HOT 5
- Displaying images in place of text labels for heatmaps HOT 9
- Cluster mitake occur in pyHeatmap HOT 2
- How to remove arrows for anno_label HOT 4
- Re-order labels in legend HOT 1
- Boxplot orientation for `left_annotation` HOT 4
- Missing annotations, and functionality to add line colors for row annotations HOT 2
- Legends not saved properly when using plt.savefig() HOT 11
- anno_boxplot AttributeError for colors parameter usage due to .copy() in check_colors HOT 1
- How to set vmax and vmin of cmap in ClusterMapPlotter() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pycomplexheatmap.