Closed kerenzhou062 closed 8 months ago
Did you set
plt.rcParams['font.family']='sans serif'
plt.rcParams['font.sans-serif']='Arial'
plt.rcParams['pdf.fonttype']=42
and use
plt.savefig("clustermap.pdf", bbox_inches='tight')
to save the figure?
If not, please do so and follow by any example on the documentation website, for example: https://dingwb.github.io/PyComplexHeatmap/build/html/notebooks/composite_heatmaps.html#Composite-two-heatmaps-horizontally-for-mouse-DNA-methylation-array-dataset
No, it doesn't work. I mean the text part is editable, but the heatmap part is an image.
Oh, I see.
Please use rasterized=False
, then the pdf should be editable.
However, when your data is enormous and set rasterized=False
, the size of the generated pdf would be very large.
Could you please tell me why you would like to edit the pdf? If you want to composite two heatmaps together, you can try the composite
function in PyComplexHeatmap. If you would like to draw a custom box or something, you can also do that in PyComplexHeatmap.
Thanks, it works now. Well, you always need to adjust the figures to fit different arrangements when get it published.
I see. Thanks for the question.
Try to save results from ClusterMapPlotter as pdf, but the heatmap is a figure not in vector.
`plt.figure(figsize=(6, 30)) cm = ClusterMapPlotter(data=data.loc[:,df_col.index.tolist()], top_annotation=col_ha,show_rownames=True, row_cluster=True,col_cluster=False, label='on/off',legend_gap=7, cmap='Purples',rasterized=True)
plt.savefig(root + "test.pdf") plt.show() `