程序实例:9 e7 Z$ ]6 I/ w8 x2 B2 x
[c,h]=contour(Si,thetai,dens,vi,'k','linewidth',1);; j: S% Z9 h8 Z% ?3 U( y9 z; v
texth=clabel(c,h,'manual','fontname','calibri','fontwei','demi','fontsi',14);& z$ c8 i6 `) j+ m
for m=1:length(texth)
; a- s! u5 R9 c! J. O4 q textstr=get(texth(m),'String');
* v1 ^0 E7 p* q textnum=str2num(textstr);
' R6 l' L. g& }5 Z/ ?& f+ k textstrnew=num2str(textnum,'%5.2f'); %设置数字格式
1 L' h- I1 s$ S5 ^+ t5 Y set(texth(m),'String',textstrnew);) ~/ k5 S& G1 C: Z- w
end$ I1 x4 v! H: c& H4 Q
y: z3 y# _ o8 b- r3 y/ R
+ q) ~' F: c$ h& w- n! b B
% [) H9 E' v8 d" x/ ^$ c; P
9 `3 v) c+ ?) K3 ? ]+ j& W/ \- ] 转载本文请联系原作者获取授权,同时请注明本文来自叶瑞杰科学网博客。 |