python+matlab text(按图的相对位置显示)

python

用 python 画图时,如果想采用归一化的坐标来指定文本框的位置,则需要用到 transform = ax.transAxes 参数,如

ax = plt.gca()
plt.text(0.1,0.2, "text", fontsize = 20, transform = ax.transAxes)

matlab

方法1

text(___,Name,Value) 使用一个或多个名称-值对组指定 Text 对象的属性。例如,‘FontSize’,14 将字体大小设置为 14 磅。您可以使用上述语法中的任意输入参数组合指定文本属性。如果您将 Position 和 String 属性指定为名称-值对组,则不需要指定 x、y、z 和 txt 输入(这种方法是使用键-对值)

text( 'string',"(a) UB-OR", 'Units','normalized','position',[0.75,0.95]);  

方法2

% TEXT(X,Y,str,‘sc’) interprets the (X,Y) points in normalized axis
% coordinates, where (0,0) is the lower-left corner of the current axes,
% and (1,1) is the upper-right.

text( 0.75,0.95,"(a) UB-OR", "sc");  

你可能感兴趣的:(matlab,python,python,matlab,数据结构)