程序实例:$ ?9 V& c2 L' f$ R* F" C# f$ g2 T
[c,h]=contour(Si,thetai,dens,vi,'k','linewidth',1);) k8 W' f9 _/ a) g) Z+ X
texth=clabel(c,h,'manual','fontname','calibri','fontwei','demi','fontsi',14);. [ l! ~, V7 h: |$ ]4 F. b3 w
for m=1:length(texth)5 [) d5 O( _* f0 K0 x2 @
textstr=get(texth(m),'String');* C0 j: E$ r i$ B, ]
textnum=str2num(textstr);( ]$ J! J2 e+ G9 X
textstrnew=num2str(textnum,'%5.2f'); %设置数字格式
% n, E& e3 l( t set(texth(m),'String',textstrnew);
; S( a$ Q+ W( J U* S1 g" o3 `end5 U: j6 {: z, U# e
' U0 j Q2 w& V9 a. R; F6 ]
5 i' i2 k8 P8 S# R5 r4 }1 \
# J6 x) m: E" Q/ m2 o- X
/ F- W0 h. I1 w0 c' }9 S& i& H: ? 转载本文请联系原作者获取授权,同时请注明本文来自叶瑞杰科学网博客。 |