程序实例:
1 C6 |; J9 U, e* ^[c,h]=contour(Si,thetai,dens,vi,'k','linewidth',1);1 P# m/ S; p' k; b/ {
texth=clabel(c,h,'manual','fontname','calibri','fontwei','demi','fontsi',14);4 ~; y& M: _8 y. g' l# d }
for m=1:length(texth)7 w$ \! I& l9 q! o
textstr=get(texth(m),'String');. G; C5 K$ v. |7 X2 L7 o7 x3 i4 W
textnum=str2num(textstr);
- o% D* e9 Y# j' q. L textstrnew=num2str(textnum,'%5.2f'); %设置数字格式
4 t$ Q% Z, V$ U+ c set(texth(m),'String',textstrnew);0 @ [3 g7 W# x7 e
end7 R$ L3 c' l, a4 g/ p; h* ~ N" s
7 r, Z) [9 O- p
# p% T; o7 {- t6 K. l8 Z3 p% S0 X / |0 ~) q4 t! C( L; O
! J2 Q) ?; ]" y+ @ 转载本文请联系原作者获取授权,同时请注明本文来自叶瑞杰科学网博客。 |