dpi_scale_trans, clip_on=False, lw=2, c='black') plt.show() plt.rcParams['savefig.pad_inches'] gives me 0.1. When I add 0.1 to line_2 coordinates, line_2 will be placed the same as line_1: fig = plt.figure(facecolor='#ccc') ax = fig.gca() ax.set_axis_off() line_1,...
一般包含了Figure.transFigure,每个方向的取值范围为0-1,表示与当前图形大小的比值,或者用Figure.dip_scale_trans(),其距离Figure左下角物理单位的英寸数。 保存Figures 最后,Figure可以用savefig()方法来保存在硬盘里。fig.savefig(’MyFigure.png‘,dpi=200)将会保存一个名为”MyFigure.png“的PNG格式文件到当前...
(image_comb) plt.plot([0,50],[0,300], lw=20, color ='red', alpha=0.3) plt.xlim(0,50) plt.ylim(0,300) plt.axis('off') [ax] = fig.get_axes() extent = ax.get_window_extent().transformed(fig.dpi_scale_trans.inverted()) plt.savefig('test_fig.png', bbox_inches = extent...