source: trunk/toolbox/colorbartype1.m @ 23

Last change on this file since 23 was 2, checked in by pinsard, 15 years ago

first commit with original work of Julien Brajard

File size: 1.1 KB
Line 
1function [h0]=colorbartype1(pos,lev,lev_pas,clip_lev,hpal,orien);
2
3% 30/10/97- NS: option "orien" pour positionner la barre verticalement
4%               ou horizontalement--> 1 ou 0
5
6if length(pos)>1
7h0 = axes('Position',pos,'Box','on');
8else
9  h0=pos;
10  axes(h0);
11  set(h0,'Box','on');
12end
13
14ind_lev=find( lev>=(clip_lev(1)-eps) & (lev<=clip_lev(2)+eps) );
15tab_lev=[lev(ind_lev);lev(ind_lev)];
16%keyboard
17% horizontale par defaut
18if (nargin < 6), orien = 0; end
19
20if orien == 0,
21
22    pcolor(tab_lev);
23    set(h0,'xticklabel', '','yticklabel','');
24    abs_bar=0:1/(length(ind_lev)-1):1;
25    for j=1:lev_pas:length(ind_lev)
26        s=num2str(lev(ind_lev(j)));
27        text(abs_bar(j),-.5,s,'Fontsize', 9, 'HorizontalAlignment', ...
28                              'Center', 'Units', 'normalized');
29    end
30
31else
32
33    pcolor(tab_lev');
34    set(h0,'xticklabel', '','yticklabel','');
35    ord_bar=0:1/(length(ind_lev)-1):1;
36    for j=1:lev_pas:length(ind_lev)
37        s=num2str(lev(ind_lev(j)));
38        text(1.5,ord_bar(j),s,'Fontsize', 9,'Units', 'normalized');
39    end
40
41end
42colormap(hpal);
43caxis(clip_lev);
44
Note: See TracBrowser for help on using the repository browser.