Changeset 2828
- Timestamp:
- 01/14/10 08:15:59 (15 years ago)
- Location:
- issm/trunk/src/m/classes/public/plot
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/classes/public/plot/checkplotoptions.m
r2827 r2828 73 73 74 74 %text 75 %1: textvalue76 75 if exist(options,'text'), 76 %1: textvalue 77 77 textvalues=getfieldvalue(options,'text'); 78 78 %ischar if only one expstyle -> create a cell … … 85 85 error('plot error message: ''text'' option should be either a string or a cell'); 86 86 end 87 end 88 %2: textweight 89 if exist(options,'textweight'), 90 textweightvalues=getfieldvalue(options,'textweight'); 91 %ischar if only one textweight -> create a cell 92 if ischar(textweightvalues), 93 textweightvalues={textweightvalues}; 94 elseif ~iscell(textweightvalues); 95 error('plot error message: ''textweight'' option should be either a string or a cell'); 96 end 97 else 98 textweightvalues={'n'}; 99 end 100 textweightvalues=repmat(textweightvalues,1,numtext); textweightvalues(numtext+1:end)=[]; 101 %3: textsize 102 if exist(options,'textsize'), 103 textsizevalues=getfieldvalue(options,'textsize'); 104 %ischar if only one textsize -> create a cell 105 if isnumeric(textsizevalues), 106 textsizevalues={textsizevalues}; 107 elseif ~iscell(textsizevalues); 108 error('plot error message: ''textsize'' option should be either a number or a cell'); 109 end 110 else 111 textsizevalues={14}; 112 end 113 textsizevalues=repmat(textsizevalues,1,numtext); textsizevalues(numtext+1:end)=[]; 114 %4: textcolor 115 if exist(options,'textcolor'), 116 textcolorvalues=getfieldvalue(options,'textcolor'); 117 %ischar if only one textcolor -> create a cell 118 if ischar(textcolorvalues), 119 textcolorvalues={textcolorvalues}; 120 elseif ~iscell(textcolorvalues); 121 error('plot error message: ''textcolor'' option should be either a string or a cell'); 122 end 123 else 124 textcolorvalues={'k'}; 125 end 126 textcolorvalues=repmat(textcolorvalues,1,numtext); textcolorvalues(numtext+1:end)=[]; 127 %4: textposition 128 if exist(options,'textposition'), 129 textpositionvalues=getfieldvalue(options,'textposition'); 130 %ischar if only one textposition -> create a cell 131 if isnumeric(textpositionvalues), 132 textpositionvalues={textpositionvalues}; 133 elseif ~iscell(textpositionvalues); 134 error('plot error message: ''textposition'' option should be either a string or a cell'); 135 end 136 else 137 error('plot error message: ''textposition'' option is missing'); 138 end 139 options=changefieldvalue(options,'text',textvalues); 140 options=changefieldvalue(options,'textsize',textsizevalues); 141 options=changefieldvalue(options,'textweight',textweightvalues); 142 options=changefieldvalue(options,'textcolor',textcolorvalues); 143 options=changefieldvalue(options,'textposition',textpositionvalues); 87 88 %2: textweight 89 if exist(options,'textweight'), 90 textweightvalues=getfieldvalue(options,'textweight'); 91 %ischar if only one textweight -> create a cell 92 if ischar(textweightvalues), 93 textweightvalues={textweightvalues}; 94 elseif ~iscell(textweightvalues); 95 error('plot error message: ''textweight'' option should be either a string or a cell'); 96 end 97 else 98 textweightvalues={'n'}; 99 end 100 textweightvalues=repmat(textweightvalues,1,numtext); textweightvalues(numtext+1:end)=[]; 101 %3: textsize 102 if exist(options,'textsize'), 103 textsizevalues=getfieldvalue(options,'textsize'); 104 %ischar if only one textsize -> create a cell 105 if isnumeric(textsizevalues), 106 textsizevalues={textsizevalues}; 107 elseif ~iscell(textsizevalues); 108 error('plot error message: ''textsize'' option should be either a number or a cell'); 109 end 110 else 111 textsizevalues={14}; 112 end 113 textsizevalues=repmat(textsizevalues,1,numtext); textsizevalues(numtext+1:end)=[]; 114 %4: textcolor 115 if exist(options,'textcolor'), 116 textcolorvalues=getfieldvalue(options,'textcolor'); 117 %ischar if only one textcolor -> create a cell 118 if ischar(textcolorvalues), 119 textcolorvalues={textcolorvalues}; 120 elseif ~iscell(textcolorvalues); 121 error('plot error message: ''textcolor'' option should be either a string or a cell'); 122 end 123 else 124 textcolorvalues={'k'}; 125 end 126 textcolorvalues=repmat(textcolorvalues,1,numtext); textcolorvalues(numtext+1:end)=[]; 127 %4: textposition 128 if exist(options,'textposition'), 129 textpositionvalues=getfieldvalue(options,'textposition'); 130 %ischar if only one textposition -> create a cell 131 if isnumeric(textpositionvalues), 132 textpositionvalues={textpositionvalues}; 133 elseif ~iscell(textpositionvalues); 134 error('plot error message: ''textposition'' option should be either a string or a cell'); 135 end 136 else 137 error('plot error message: ''textposition'' option is missing'); 138 end 139 options=changefieldvalue(options,'text',textvalues); 140 options=changefieldvalue(options,'textsize',textsizevalues); 141 options=changefieldvalue(options,'textweight',textweightvalues); 142 options=changefieldvalue(options,'textcolor',textcolorvalues); 143 options=changefieldvalue(options,'textposition',textpositionvalues); 144 end 144 145 145 146 %expdisp -
issm/trunk/src/m/classes/public/plot/plot_manager.m
r2827 r2828 3 3 % 4 4 % Usage: 5 % plot_manager(md,options, width,i);5 % plot_manager(md,options,subplotwidth,i); 6 6 % 7 7 % See also: PLOTMODEL, PLOT_UNIT … … 19 19 20 20 case 'boundaries', 21 plot_boundaries(md,options, width,i);21 plot_boundaries(md,options,subplotwidth,i); 22 22 return; 23 23 case 'elementnumbering', 24 plot_elementnumbering(md,options, width,i);24 plot_elementnumbering(md,options,subplotwidth,i); 25 25 return; 26 26 case 'highlightelements', 27 plot_highlightelements(md,options, width,i);27 plot_highlightelements(md,options,subplotwidth,i); 28 28 return; 29 29 case 'segmentnumbering', 30 plot_segmentnumbering(md,options, width,i);30 plot_segmentnumbering(md,options,subplotwidth,i); 31 31 return; 32 32 case 'histnorm', 33 plot_qmuhistnorm(md,options, width,i);33 plot_qmuhistnorm(md,options,subplotwidth,i); 34 34 return; 35 35 case 'elements_type', 36 plot_elementstype(md,options, width,i);36 plot_elementstype(md,options,subplotwidth,i); 37 37 return; 38 38 case 'gridnumbering', 39 plot_gridnumbering(md,options, width,i);39 plot_gridnumbering(md,options,subplotwidth,i); 40 40 return; 41 41 case 'highlightgrids', 42 plot_highlightgrids(md,options, width,i);42 plot_highlightgrids(md,options,subplotwidth,i); 43 43 return; 44 44 case {'basal_drag','basal_dragx','basal_dragy'}, 45 plot_basaldrag(md,options, width,i,data);45 plot_basaldrag(md,options,subplotwidth,i,data); 46 46 return; 47 47 case 'driving_stress', 48 plot_drivingstress(md,options, width,i);48 plot_drivingstress(md,options,subplotwidth,i); 49 49 return; 50 50 case 'mesh', 51 plot_mesh(md,options, width,i);51 plot_mesh(md,options,subplotwidth,i); 52 52 return; 53 53 case 'penalties', 54 plot_penalties(md,options, width,i);54 plot_penalties(md,options,subplotwidth,i); 55 55 return; 56 56 case 'riftvel', 57 plot_riftvel(md,options, width,i);57 plot_riftvel(md,options,subplotwidth,i); 58 58 return; 59 59 case 'rifts', 60 plot_rifts(md,options, width,i);60 plot_rifts(md,options,subplotwidth,i); 61 61 return; 62 62 case 'riftrelvel', 63 plot_riftrelvel(md,options, width,i);63 plot_riftrelvel(md,options,subplotwidth,i); 64 64 return; 65 65 case 'riftpenetration', 66 plot_riftpenetration(md,options, width,i);66 plot_riftpenetration(md,options,subplotwidth,i); 67 67 return; 68 68 case 'riftfraction', 69 plot_riftfraction(md,options, width,i);69 plot_riftfraction(md,options,subplotwidth,i); 70 70 return; 71 71 case 'sarpwr', 72 plot_sarpwr(md,options, width,i)72 plot_sarpwr(md,options,subplotwidth,i) 73 73 return 74 74 case 'pressureload' 75 plot_pressureload(md,options, width,i,data)75 plot_pressureload(md,options,subplotwidth,i,data) 76 76 return 77 77 case 'segments' 78 plot_segments(md,options, width,i,data)78 plot_segments(md,options,subplotwidth,i,data) 79 79 return 80 80 case {'strainrate_tensor','strainrate','strainrate_principal','strainrate_principalaxis1','strainrate_principalaxis2','strainrate_principalaxis3',... 81 81 'stress_tensor','stress','stress_principal','stress_principalaxis1','stress_principalaxis2','stress_principalaxis3',... 82 82 'deviatoricstress_tensor','deviatoricstress','deviatoricstress_principal','deviatoricstress_principalaxis1','deviatoricstress_principalaxis2','deviatoricstress_principalaxis3'}, 83 plot_tensor(md,options, width,i,data);83 plot_tensor(md,options,subplotwidth,i,data); 84 84 return; 85 85 case 'thermaltransient_results', 86 plot_thermaltransient_results(md,options, width,i);86 plot_thermaltransient_results(md,options,subplotwidth,i); 87 87 return; 88 88 case 'transient_movie', 89 plot_transient_movie(md,options, width,i);89 plot_transient_movie(md,options,subplotwidth,i); 90 90 return; 91 91 case 'transient_results', 92 plot_transient_results(md,options, width,i);92 plot_transient_results(md,options,subplotwidth,i); 93 93 case {'transient_thickness','transient_bed','transient_surface','transient_temperature','transient_melting','transient_vel','transient_vx','transient_vy','transient_vz','transient_pressure'} 94 plot_transient_field(md,options, width,i,data);94 plot_transient_field(md,options,subplotwidth,i,data); 95 95 return; 96 96 … … 107 107 %Figure out if this is a semi-transparent plot. 108 108 if exist(options,'overlay'), 109 plot_overlay(md,data,options, width,i);109 plot_overlay(md,data,options,subplotwidth,i); 110 110 return; 111 111 end … … 113 113 %Figure out if this is a Section plot 114 114 if exist(options,'sectionvalue') 115 plot_section(md,data,options, width,i);115 plot_section(md,data,options,subplotwidth,i); 116 116 return; 117 117 end
Note:
See TracChangeset
for help on using the changeset viewer.