[x,y,z]=peaks(60);4 G. f; g% H' G3 w2 a6 |
mesh(x,y,z);+ ?5 d6 Z; B' J+ ^; _
h=colorbar;, G- x2 Q a# f0 J6 \ [) s" r
set(get(h,'title'),'string','km');" F+ i. i# r5 ^$ r! a F
" @- S ^& A$ Q1 q5 ~" O; V* Z G% m/ t, Z
有时不是在title上加单位,而是在数字上面加,可以:
0 ~- f6 S T5 E% ]h=colorbar;$ ~4 K2 L# m+ v P" m4 a
t=get(h,'Yticklabel');
6 y0 S6 x0 m b p1 C( G2 C+ P, et=strcat(t,'km');
A6 e s# P2 C% w- _' Kset(h,'Yticklabel',t);
2 R+ H- x0 x) n+ N2 i: y设置colorbar字体大小为14号:
" t8 @/ K: p+ d, n1 V* ^colorbar('Fontsize',14);: h4 [7 f& J) u0 |
或者
# ], i7 b4 L* K% [( Nh=colorbar;: o9 W, T% S+ _4 _
set(h,'Fontsize',14)
6 G0 X( g, p ^9 P, q6 `$ _
# n+ {! H; y/ c1 q" ?" f( `4 }0 R/ a5 _' `! [6 `
$ s; s7 y2 \1 d/ U, J, |6 a, a
0 O- l5 y6 V/ I0 b : D, v* A4 S6 K$ R* W' E
' `0 w% C# M5 V1 t# }! h 转载本文请联系原作者获取授权,同时请注明本文来自叶瑞杰科学网博客。 |