程序实例:; R( g0 B0 U3 T3 n, J3 m: c
[c,h]=contour(Si,thetai,dens,vi,'k','linewidth',1);
; Q6 C9 o1 |; F& z/ K, w. y. Ztexth=clabel(c,h,'manual','fontname','calibri','fontwei','demi','fontsi',14);
9 L8 W: P6 S' E' @. t {1 |. s3 kfor m=1:length(texth)" [( ?" i* K/ G4 I$ q0 E4 P7 M f# d
textstr=get(texth(m),'String');/ W' l/ t1 C3 Y+ @5 J; f5 B
textnum=str2num(textstr);4 ~3 ^8 y. { L8 J
textstrnew=num2str(textnum,'%5.2f'); %设置数字格式
( t; p- M* q9 G3 _2 | T7 r7 H set(texth(m),'String',textstrnew);/ _- c" {0 \5 I; `# @1 v
end: ~0 M! b- i @$ f4 f: W
" N! _5 J0 s7 Z
* M& ?2 F! c" p. E# ~) _
) _% G% {& i. q
+ _4 k9 d& G- ]2 d* i1 N# }
转载本文请联系原作者获取授权,同时请注明本文来自叶瑞杰科学网博客。 |