![](/img/trans.png)
[英]How to create multiple seaborn heatmaps with a shared legend in one figure?
[英]How to plot several seaborn heatmaps in a single figure?
我已經使用scVelo生成了一個 sns 熱圖(ClusterGrid 對象),但是如何將這些對象放入 matplotlib 中的單個圖形中?
我已經厭倦了很多選擇(當然也嘗試了我可以在 StackOverflow 上找到的任何建議:)但似乎沒有任何效果。 我可以導出為 png 並重新加載數據,但這會降低圖像質量。
有什么建議么?
謝謝!
這不是最佳解決方案,但這是我能夠想到的。將圖像保存為 PNG 文件,然后將它們重新加載為子圖
plt.figure(figsize=(30, 15))
plt.suptitle("title", fontsize=22)
plt.subplot(133)
plt.imshow(mpimg.imread('./figures/heatmap_2.png',format="png"))
plt.title("expression")
plt.grid(None)
plt.axis('off')
plt.subplot(132)
plt.imshow(mpimg.imread('./figures/heatmap_1.png'), format="png"))
plt.grid(None)
plt.axis('off')
plt.subplot(131)
plt.imshow(mpimg.imread('./figures/3.png',format="png"))
#plt.grid(None)
plt.grid(None)
plt.axis('off')
plt.show()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.