保留坐标轴,对点层做栅格化
sc.pl.tsne(scanpy_object_integrated, color='Annotation_broad', show=False, size=2) ax = plt.gca() for coll in ax.collections: coll.set_rasterized(True) '#栅格化点层 fig_used=plt.gcf() # capture the new plot fig_used.set_size_inches(6,6) # change the size of the current plot fig_used.savefig("/data/plot___1___tSNE___1.pdf", format="pdf", dpi=600, bbox_inches="tight")Note:
dpi=600,注意要使用高分辨率
去除坐标轴,对点层做栅格化
sc.pl.tsne(scanpy_object_integrated, color='Annotation_broad', show=False, frameon=False, title='', legend_loc=None, size=2) ax = plt.gca() for coll in ax.collections: coll.set_rasterized(True) '#栅格化点层 plt.gca().set_frame_on(False) # 去除坐标轴边框 plt.gca().axis('off') fig_used=plt.gcf() # capture the new plot fig_used.set_size_inches(6,6) # change the size of the current plot fig_used.savefig("/data/plot___1___tSNE___2.pdf", format="pdf", dpi=600, bbox_inches="tight")Note:
dpi=600,注意要使用高分辨率

