Changeset 12390
- Timestamp:
- 06/08/12 11:39:59 (13 years ago)
- Location:
- issm/trunk-jpl/src/m/model/plot
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/model/plot/applyoptions.m
r12309 r12390 31 31 end 32 32 33 %xlabel 33 %xlabel, ylabel and zlabel 34 34 if exist(options,'xlabel'); 35 35 xlabel(getfieldvalue(options,'xlabel'),'FontSize',fontsize,'FontWeight',fontweight); 36 36 end 37 38 %ylabel39 37 if exist(options,'ylabel'); 40 38 ylabel(getfieldvalue(options,'ylabel'),'FontSize',fontsize,'FontWeight',fontweight); 41 39 end 42 43 %zlabel44 40 if exist(options,'zlabel'); 45 41 zlabel(getfieldvalue(options,'zlabel'),'FontSize',fontsize,'FontWeight',fontweight); 46 42 end 47 43 48 %xti kcs44 %xticks, yticks and zticks 49 45 if exist(options,'xtick'), set(gca,'XTick',getfieldvalue(options,'xtick')); end 50 46 if exist(options,'ytick'), set(gca,'YTick',getfieldvalue(options,'ytick')); end … … 75 71 end 76 72 77 %xlim 73 %xlim, ylim and zlim 78 74 if exist(options,'xlim'); 79 75 xlim(getfieldvalue(options,'xlim')); 80 76 end 81 82 %ylim83 77 if exist(options,'ylim'); 84 78 ylim(getfieldvalue(options,'ylim')); 79 end 80 if exist(options,'zlim'); 81 zlim(getfieldvalue(options,'zlim')); 85 82 end 86 83 … … 92 89 end 93 90 94 95 %zlim96 if exist(options,'zlim');97 zlim(getfieldvalue(options,'zlim'));98 end99 100 91 %Basinzoom 101 92 if exist(options,'basin'); … … 107 98 showbasins(options); 108 99 end 109 110 100 111 101 %Caxis … … 133 123 c = c (32:end,:); 134 124 elseif strcmpi(cname,'redblue'), 135 %m = 30;136 %n = fix(0.5*m);137 %r = [(0:1:n-1)/n,ones(1,n)];138 %g = [(0:n-1)/n, (n-1:-1:0)/n];139 %b = [ones(1,n),(n-1:-1:0)/n];140 %c = [r(:), g(:), b(:)];141 142 125 c = hsv(64); 143 126 c = rgb2hsv(c); … … 146 129 c(33:end,1) = 1; 147 130 c = hsv2rgb(c); 148 149 131 elseif strcmpi(cname,'Rignot'), 150 c = hsv; 151 152 %adjust saturation 132 c = hsv(252); 153 133 c = rgb2hsv(c); 154 134 alpha=getfieldvalue(options,'alpha',1); 155 135 c(:,2) = max(min( (0.1+c(:,1)).^(1/alpha) ,1),0); 156 136 c = hsv2rgb(c); 157 158 137 elseif strcmpi(cname,'Rignot2'), 159 c = hsv; 160 161 %adjust saturation 138 c = hsv(252); 162 139 c = rgb2hsv(c); 163 140 alpha=getfieldvalue(options,'alpha',1); 164 141 c(:,2) = max(min( (0.1+c(:,1)).^(1/alpha) ,1),0); 165 142 c = hsv2rgb(c); 166 167 143 c=flipud(c); 168 144 elseif strcmpi(cname,'Seroussi'), 145 c = hsv(252); 146 c = flipud(c); 147 c = c(1:floor(0.7*size(c,1)),:); 148 c = rgb2hsv(c); 149 alpha=getfieldvalue(options,'alpha',1); 150 c(:,2) = max(min( (0.1+c(:,1)).^(1/alpha) ,1),0); 151 c = hsv2rgb(c); 152 %c = flipud(c); 169 153 else 170 154 c = cname; -
issm/trunk-jpl/src/m/model/plot/plot_overlay.m
r12309 r12390 77 77 78 78 colorm=getfieldvalue(options,'colormap','Rignot'); 79 if strcmpi(colorm,'Rignot'), 80 %hue (H) 81 h_data=(data_grid-data_min)/(data_max-data_min+eps); 82 if radaronly, h_data(:)=0; end 83 %saturation (S) 84 s_data=max(min((0.1+h_data).^(1/transparency),1),0); 85 elseif strcmpi(colorm,'Seroussi'), 86 %hue (H) 87 h_data=1-(data_grid-data_min)/(data_max-data_min+eps)*0.7; 88 %h_data=(data_grid-data_min)/(data_max-data_min)*2/3; 89 if radaronly, h_data(:)=0; end 90 %saturation (S) 91 s_data=max(min((0.1+h_data).^(1/transparency),1),0); 92 elseif strcmpi(colorm,'redblue') 93 data_mean=data_min+(data_max-data_min)/2; 94 %hue (H) 95 %h_data=0.7*ones(size(data_grid)); 96 %h_data(find(data_grid>data_mean))=1; 97 h_data=1*ones(size(data_grid)); 98 h_data(find(data_grid<data_mean))=0.7; 99 %saturation (S) 100 s_data=max(min(abs(data_grid-data_mean)/(data_max-data_mean) ,1),0); 79 80 %Special colormaps that require hsv treatment 81 if strcmpi(colorm,'Rignot') | strcmpi(colorm,'Seroussi') | strcmpi(colorm,'redblue') 82 if strcmpi(colorm,'Rignot'), 83 h=(data_grid-data_min)/(data_max-data_min+eps); 84 if radaronly, h(:)=0; end 85 s=max(min((0.1+h).^(1/transparency),1),0); 86 elseif strcmpi(colorm,'Seroussi'), 87 h=1-(data_grid-data_min)/(data_max-data_min+eps)*0.7; 88 if radaronly, h(:)=0; end 89 s=max(min((0.1+h).^(1/transparency),1),0); 90 elseif strcmpi(colorm,'redblue') 91 data_mean=data_min+(data_max-data_min)/2; 92 h=1*ones(size(data_grid)); 93 h(find(data_grid<data_mean))=0.7; 94 s=max(min(abs(data_grid-data_mean)/(data_max-data_mean) ,1),0); 95 else 96 error('colormap not supported yet. (''Rignot'' and ''redblue'' are the only cupported colormaps)'); 97 end 98 99 %(S) Saturation is 0 in NaNs 100 s(data_nan)=0; 101 102 %(V) intensity is based on radar image 103 radar=(md.radaroverlay.pwr).^(contrast); 104 v=radar/max(radar(:)); %use radar power as intensity 105 %pos=find(v==0);v(pos)=1; %Change background from black to white 106 107 %Transform HSV to RGB 108 image_hsv=zeros(size(data_grid,1),size(data_grid,2),3); 109 image_hsv(:,:,1)=h; clear h; 110 image_hsv(:,:,2)=s; clear s; 111 image_hsv(:,:,3)=v; clear v; 112 image_rgb=hsv2rgb(image_hsv); 101 113 else 102 error('colormap not supported yet. (''Rignot'' and ''redblue'' are the only cupported colormaps)'); 114 if ischar(colorm), 115 eval(['colorm = ' colorm ';']); 116 end 117 len = size(colorm,1); 118 119 ind = floor((len-1)*(data_grid-data_min)/(data_max - data_min + eps) +1); 120 image_rgb=zeros(size(data_grid,1),size(data_grid,2),3); 121 r=colorm(:,1); image_rgb(:,:,1)=r(ind); clear r; 122 g=colorm(:,2); image_rgb(:,:,2)=g(ind); clear g; 123 b=colorm(:,3); image_rgb(:,:,3)=b(ind); clear b; 124 125 %Now add radarmap 126 image_hsv=rgb2hsv(image_rgb); 127 radar = (md.radaroverlay.pwr).^(contrast); 128 h=radar/max(radar(:)); 129 image_hsv(:,:,3)=h; 130 s=image_hsv(:,:,2); 131 s(data_nan)=0; 132 image_hsv(:,:,2)=s; 133 v=image_hsv(:,:,3); 134 %pos=find(v==0);v(pos)=1; %Change background from black to white 135 image_hsv(:,:,3)=v; 136 image_rgb=hsv2rgb(image_hsv); 103 137 end 104 105 %Saturation is 0 in NaNs106 s_data(data_nan)=0;107 %intensity (V)108 radar=(md.radaroverlay.pwr).^(contrast);109 v_data=radar/max(radar(:)); %use radar power as intensity110 111 %Change background from black to white112 %pos=find(v_data==0);v_data(pos)=1;113 114 %Transform HSV to RGB115 image_hsv=zeros(size(data_grid,1),size(data_grid,2),3);116 image_hsv(:,:,1)=h_data;117 image_hsv(:,:,2)=s_data;118 image_hsv(:,:,3)=v_data;119 image_rgb=hsv2rgb(image_hsv);120 138 121 139 %Select plot area -
issm/trunk-jpl/src/m/model/plot/plotmodel.m
r11828 r12390 48 48 for i=1:numberofplots, 49 49 plot_manager(getfieldvalue(options.list{i},'model',md),options.list{i},subplotwidth,nlines,ncols,i); 50 %cbfreeze; 50 51 51 end 52 52 catch me,
Note:
See TracChangeset
for help on using the changeset viewer.