Changeset 1746
- Timestamp:
- 08/18/09 14:10:04 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/classes/public/plot/plot_quiver.m
r1745 r1746 18 18 if isnan(options_structure.scaling), 19 19 arrow=0.40; 20 elseif isnumeric(options_structure.scaling), 21 arrow=options_structure.scaling; 22 elseif ischar(options_structure.scaling) & strcmpi(options_structure.scaling,'off'), 23 arrow=NaN; 20 24 else 21 arrow=options_structure.scaling;25 error('plot_quiver error message: scaling option other than scalaer or ''off'' not supported yet') 22 26 end 23 27 … … 54 58 55 59 %Scale data 56 delta=((min(x)-max(x))^2+(min(y)-max(y))^2)/numel(x); 57 u=arrow*sqrt(delta)*u./Norm; 58 v=arrow*sqrt(delta)*v./Norm; 60 if ~isnan(arrow), 61 delta=((min(x)-max(x))^2+(min(y)-max(y))^2)/numel(x); 62 u=arrow*sqrt(delta)*u./Norm; 63 v=arrow*sqrt(delta)*v./Norm; 64 end 59 65 60 66 %loop over the number of colors … … 69 75 %take care of colorbar 70 76 if ~strcmpi(options_structure.colorbar,'off'), 77 78 %build ticks 71 79 hcb=colorbar('peer',gca,'location','EastOutside'); 72 tick n=cell(1,length(levels));80 ticklabel=cell(1,length(levels)); 73 81 for i=1:length(levels), 74 tick n{i}=num2str(levels(i));82 ticklabel{i}=num2str(levels(i)); 75 83 end 76 set(hcb,'YTickLabel',tickn,'YTick',1:numcolors+1); 84 tickpos=1:numcolors+1; 85 86 %remove ticks if to many have been created 87 proportion=round(length(levels)/10); 88 if proportion>1, 89 ticklabel=ticklabel(1:proportion:end); 90 tickpos=tickpos(1:proportion:end); 91 end 92 93 %draw colorbar 94 set(hcb,'YTickLabel',ticklabel,'YTick',tickpos); 77 95 %position 78 96 if ~isnan(options_structure.colorbarpos), … … 87 105 set(hcb,'FontSize',fontsize); 88 106 end 89 90 %Now no colorbar done by
Note:
See TracChangeset
for help on using the changeset viewer.