Changeset 8728
- Timestamp:
- 06/28/11 00:40:35 (14 years ago)
- Location:
- issm/trunk/src/m
- Files:
-
- 8 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/classes/version/7.7/model.m
r8650 r8728 26 26 bamg=struct(); 27 27 dim=0; 28 planet=0;29 28 numberofelements=0; 30 29 numberofnodes=0; -
issm/trunk/src/m/model/plot/applyoptions.m
r8420 r8728 222 222 if exist(options,'colorbartitle'), 223 223 set(get(c,'title'),'FontSize',getfieldvalue(options,'colorbarfontsize',fontsize),'String',getfieldvalue(options,'colorbartitle'),... 224 'Color',getfieldvalue(options,'FontColor','k'),'Interpreter',getfieldvalue(options,'Interpreter','none') );224 'Color',getfieldvalue(options,'FontColor','k'),'Interpreter',getfieldvalue(options,'Interpreter','none'),'Interpreter','Tex'); 225 225 end 226 226 if exist(options,'colorbarYLabel'), -
issm/trunk/src/m/model/plot/plot_mesh.m
r8472 r8728 22 22 patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth); 23 23 else 24 if ~ md.planet,24 if ~isplanet, 25 25 A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6); 26 26 patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth); … … 30 30 patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth); 31 31 else 32 A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); 32 A=elements(:,1); B=elements(:,2); C=elements(:,3); 33 if (size(elements,2)==4), D=elements(:,4); else D=C; end 33 34 patch( 'Faces', [A B C D], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor',edgecolor,'linewidth',linewidth); 34 35 35 end 36 36 end -
issm/trunk/src/m/model/plot/plot_qmuhistnorm.m
r7546 r8728 38 38 if exist(options,'cdfleg'), cdfleg=getfieldvalue(options,'cdfleg'); qmuoptions=[qmuoptions ',''cdfleg'',''' cdfleg '''']; end 39 39 if exist(options,'nrmplt'), nrmplt=getfieldvalue(options,'nrmplt'); qmuoptions=[qmuoptions ',''nrmplt'',''' nrmplt '''']; end 40 if exist(options,'EdgeColor'), EdgeColor=getfieldvalue(options,'EdgeColor'); qmuoptions=[qmuoptions ',''EdgeColor'',''' EdgeColor '''']; end 41 if exist(options,'FaceColor'), FaceColor=getfieldvalue(options,'FaceColor'); qmuoptions=[qmuoptions ',''FaceColor'',''' FaceColor '''']; end 40 42 41 43 %use qmu plot -
issm/trunk/src/m/model/plot/plot_section.m
r8472 r8728 25 25 %Get number of curves and generate random colors 26 26 numcurves=size(data,2); 27 colorm=getfieldvalue(options,'colormap',' jet');28 color=eval([ colorm '(numcurves);']) ;27 colorm=getfieldvalue(options,'colormap','lines'); 28 color=eval([ colorm '(numcurves);']) 29 29 options=removefield(options,'colormap',0); %back to default colormap 30 30 … … 35 35 end 36 36 37 %Loop over number of curves 38 for i=1:numcurves, 39 40 [datai datatype]=processdata(md3d,data(:,i),options); 41 42 %resolution 43 if exist(options,'resolution'), 44 resolution=getfieldvalue(options,'resolution'); 45 else %Default resolution 46 resolution=[1000 10*md.numlayers]; 47 disp(['plot_section warning: no resolution specified, use default resolution: [horizontal_resolution vertical_resolution]=[' num2str(resolution) ']']); 48 end 49 50 %Compute section value 51 [elements,x,y,z,s,data_s]=SectionValues(md,datai,getfieldvalue(options,'sectionvalue'),resolution); 52 53 %units 54 if exist(options,'unit'), 55 unit=getfieldvalue(options,'unit'); 56 x=x*unit; 57 y=y*unit; 58 z=z*unit; 59 s=s*unit; 60 end 61 62 %2D 63 if is2d 64 65 %Show Section if requested by user 66 if exist(options,'showsection') 67 68 %compute number of labels 69 numlabels=min(getfieldvalue(options,'showsection'),length(s)); 70 shift=fix(length(s)/numlabels); 71 72 %plot labels on current graph 73 hold on 74 text(s(1),data_s(1),'1','backgroundcolor',[0.8 0.9 0.8]) 75 for i=2:numlabels-1 76 text(s(1+(i-1)*shift),data_s(1+(i-1)*shift),num2str(i),'backgroundcolor',[0.8 0.9 0.8]) 77 end 78 text(s(end),data_s(end),'end','backgroundcolor',[0.8 0.9 0.8]) 79 80 %plot section only with labels 81 subplot(nlines,ncols,index2) 82 plot_unit(x_m,y_m,z_m,elements_m,data(:,i),is2d,isplanet,datatype,options) 83 hold on 84 text(x(1),y(1),'1','backgroundcolor',[0.8 0.9 0.8]) 85 for i=2:numlabels-1 86 text(x(1+(i-1)*shift),y(1+(i-1)*shift),num2str(i),'backgroundcolor',[0.8 0.9 0.8]) 87 end 88 text(x(end),y(end),'end','backgroundcolor',[0.8 0.9 0.8]) 89 plot(x,y,'-r') 90 axis([min(md.x)-1 max(md.x)+1 min(md.y)-1 max(md.y)+1]) 91 view(2) 37 %read contours: 38 profiles=expread(getfieldvalue(options,'sectionvalue'),1); 39 numprofiles=length(profiles); 40 41 %Loop over number of profiles: 42 for profile_i=1:numprofiles, 43 profile=profiles(profile_i); 44 45 %Loop over number of curves 46 for i=1:numcurves, 47 48 [datai datatype]=processdata(md3d,data(:,i),options); 49 50 %resolution 51 if exist(options,'resolution'), 52 resolution=getfieldvalue(options,'resolution'); 53 else %Default resolution 54 resolution=[1000 10*md.numlayers]; 55 disp(['plot_section warning: no resolution specified, use default resolution: [horizontal_resolution vertical_resolution]=[' num2str(resolution) ']']); 92 56 end 93 57 94 % plotsection value95 hold on;96 subplot(nlines,ncols,index1) 97 % subplot(1,3,[2 3])98 if i==1,99 plot(s,data_s,'-','color','k','LineWidth',getfieldvalue(options,'linewidth',1))100 elseif i==2,101 plot(s,data_s,':','color',color(i,:),'LineWidth',getfieldvalue(options,'linewidth',1))102 else103 plot(s,data_s,'--','color',color(i,:),'LineWidth',getfieldvalue(options,'linewidth',1))58 %Compute section value 59 [elements,x,y,z,s,data_s]=SectionValues(md,datai,profile,resolution); 60 61 %units 62 if exist(options,'unit'), 63 unit=getfieldvalue(options,'unit'); 64 x=x*unit; 65 y=y*unit; 66 z=z*unit; 67 s=s*unit; 104 68 end 105 69 106 107 %3D 108 else 109 %plot section value 110 %if user requested view2: 2d plot with curvilinear coordinate 111 if (getfieldvalue(options,'view',3)==2 ) 70 %2D 71 if is2d 112 72 113 73 %Show Section if requested by user … … 120 80 %plot labels on current graph 121 81 hold on 122 text(s(1), z(1),'1','backgroundcolor',[0.8 0.9 0.8])82 text(s(1),data_s(1),'1','backgroundcolor',[0.8 0.9 0.8]) 123 83 for i=2:numlabels-1 124 text(s(1+(i-1)*shift), z(1+(i-1)*shift),num2str(i),'backgroundcolor',[0.8 0.9 0.8])125 end 126 text(s(end), z(end),'end','backgroundcolor',[0.8 0.9 0.8])84 text(s(1+(i-1)*shift),data_s(1+(i-1)*shift),num2str(i),'backgroundcolor',[0.8 0.9 0.8]) 85 end 86 text(s(end),data_s(end),'end','backgroundcolor',[0.8 0.9 0.8]) 127 87 128 88 %plot section only with labels 129 89 subplot(nlines,ncols,index2) 130 plot_unit(x_m,y_m,z_m,elements_m,data(:,i),is2d, datatype,options)90 plot_unit(x_m,y_m,z_m,elements_m,data(:,i),is2d,isplanet,datatype,options) 131 91 hold on 132 92 text(x(1),y(1),'1','backgroundcolor',[0.8 0.9 0.8]) … … 140 100 end 141 101 102 %plot section value 103 hold on; 142 104 subplot(nlines,ncols,index1) 143 A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); 144 patch( 'Faces', [A B C D], 'Vertices', [s z zeros(length(s),1)],'FaceVertexCData',data_s,'FaceColor','interp','EdgeColor','none'); 145 105 %subplot(1,3,[2 3]) 106 plot(s,data_s,'color',color(i,:),'LineWidth',getfieldvalue(options,'linewidth',1)) 107 108 109 %3D 146 110 else 147 148 %Show Section if requested by user 149 if exist(options,'showsection') 150 151 %compute number of labels 152 numlabels=min(getfieldvalue(options,'showsection'),length(s)); 153 shift=fix(length(x)/numlabels); 154 155 %plot labels on current graph 156 hold on 157 text(x(1),y(1),z(1),'1','backgroundcolor',[0.8 0.9 0.8]) 158 for i=2:numlabels-1 159 text(x(1+(i-1)*shift),y(1+(i-1)*shift),z(1+(i-1)*shift),num2str(i),'backgroundcolor',[0.8 0.9 0.8]) 160 end 161 text(x(end),y(end),z(end),'end','backgroundcolor',[0.8 0.9 0.8]) 162 163 %plot section only with labels 164 subplot(nlines,ncols,index2) 165 plot_unit(x_m,y_m,z_m,elements_m,data,is2d,datatype,options) 166 hold on 167 text(x(1),y(1),'1','backgroundcolor',[0.8 0.9 0.8]) 168 for i=2:numlabels-1 169 text(x(1+(i-1)*shift),y(1+(i-1)*shift),num2str(i),'backgroundcolor',[0.8 0.9 0.8]) 170 end 171 text(x(end),y(end),'end','backgroundcolor',[0.8 0.9 0.8]) 172 plot(x,y,'-r') 173 axis([min(md.x)-1 max(md.x)+1 min(md.y)-1 max(md.y)+1]) 174 view(2) 111 %plot section value 112 %if user requested view2: 2d plot with curvilinear coordinate 113 if (getfieldvalue(options,'view',3)==2 ) 114 115 %Show Section if requested by user 116 if exist(options,'showsection') 117 118 %compute number of labels 119 numlabels=min(getfieldvalue(options,'showsection'),length(s)); 120 shift=fix(length(s)/numlabels); 121 122 %plot labels on current graph 123 hold on 124 text(s(1),z(1),'1','backgroundcolor',[0.8 0.9 0.8]) 125 for i=2:numlabels-1 126 text(s(1+(i-1)*shift),z(1+(i-1)*shift),num2str(i),'backgroundcolor',[0.8 0.9 0.8]) 127 end 128 text(s(end),z(end),'end','backgroundcolor',[0.8 0.9 0.8]) 129 130 %plot section only with labels 131 subplot(nlines,ncols,index2) 132 plot_unit(x_m,y_m,z_m,elements_m,data(:,i),is2d,datatype,options) 133 hold on 134 text(x(1),y(1),'1','backgroundcolor',[0.8 0.9 0.8]) 135 for i=2:numlabels-1 136 text(x(1+(i-1)*shift),y(1+(i-1)*shift),num2str(i),'backgroundcolor',[0.8 0.9 0.8]) 137 end 138 text(x(end),y(end),'end','backgroundcolor',[0.8 0.9 0.8]) 139 plot(x,y,'-r') 140 axis([min(md.x)-1 max(md.x)+1 min(md.y)-1 max(md.y)+1]) 141 view(2) 142 end 143 144 subplot(nlines,ncols,index1) 145 A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); 146 patch( 'Faces', [A B C D], 'Vertices', [s z zeros(length(s),1)],'FaceVertexCData',data_s,'FaceColor','interp','EdgeColor','none'); 147 148 else 149 150 %Show Section if requested by user 151 if exist(options,'showsection') 152 153 %compute number of labels 154 numlabels=min(getfieldvalue(options,'showsection'),length(s)); 155 shift=fix(length(x)/numlabels); 156 157 %plot labels on current graph 158 hold on 159 text(x(1),y(1),z(1),'1','backgroundcolor',[0.8 0.9 0.8]) 160 for i=2:numlabels-1 161 text(x(1+(i-1)*shift),y(1+(i-1)*shift),z(1+(i-1)*shift),num2str(i),'backgroundcolor',[0.8 0.9 0.8]) 162 end 163 text(x(end),y(end),z(end),'end','backgroundcolor',[0.8 0.9 0.8]) 164 165 %plot section only with labels 166 subplot(nlines,ncols,index2) 167 plot_unit(x_m,y_m,z_m,elements_m,data,is2d,datatype,options) 168 hold on 169 text(x(1),y(1),'1','backgroundcolor',[0.8 0.9 0.8]) 170 for i=2:numlabels-1 171 text(x(1+(i-1)*shift),y(1+(i-1)*shift),num2str(i),'backgroundcolor',[0.8 0.9 0.8]) 172 end 173 text(x(end),y(end),'end','backgroundcolor',[0.8 0.9 0.8]) 174 plot(x,y,'-r') 175 axis([min(md.x)-1 max(md.x)+1 min(md.y)-1 max(md.y)+1]) 176 view(2) 177 end 178 179 subplot(nlines,ncols,index1) 180 A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); 181 patch( 'Faces', [A B C D], 'Vertices', [x y z],'FaceVertexCData',data_s,'FaceColor','interp','EdgeColor','none'); 182 view(3) 183 175 184 end 176 177 subplot(nlines,ncols,index1)178 A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4);179 patch( 'Faces', [A B C D], 'Vertices', [x y z],'FaceVertexCData',data_s,'FaceColor','interp','EdgeColor','none');180 view(3)181 182 185 end 183 186 end -
issm/trunk/src/m/model/plot/plot_unit.m
r8472 r8728 42 42 patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor); 43 43 else 44 A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); 44 A=elements(:,1); B=elements(:,2); C=elements(:,3); 45 if size(elements,2)==4, D=elements(:,4); else D=C; end 45 46 patch( 'Faces', [A B C D], 'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor); 46 47 end -
issm/trunk/src/m/model/plot/processmesh.m
r8472 r8728 92 92 end 93 93 94 if md.planet,94 if isa(md,'planet'), 95 95 isplanet=1; 96 96 else
Note:
See TracChangeset
for help on using the changeset viewer.