我的代码中有两个ax.annotate语句。第一行文字我想变大。第二行文本应按比例缩小
for i,j,k in zip(x_power,y_power,net_name_power):
ax.annotate(str(k), xy=(i, j), color='white', fontsize=1, weight='light', horizontalalignment='center', verticalalignment='bottom')
ax.annotate('{} , {}'.format(str(round(i,3)),str(round(j,3))), xy=(i, j), color='blue', fontsize=0.1, weight='light', horizontalalignment='center', verticalalignment='top')
ax.annotate的fontsize未缩放到fontsize=1以下
在图像中,白色文本为fontsize=1,而蓝色文本为fontsize=0.1。但正如人们所看到的,这两个文本大小相同。 我使用plt.savefig('output.PDF') .
我希望蓝色文本缩小比例,以便整齐地与红色圆形标记相匹配。有人能提出解决办法吗
谢谢
我认为最小字体点大小为1。请参见此处的源代码:
您可以尝试改用字符串描述符:
例如:
fontsize='xx-small'
相关问题 更多 >
编程相关推荐