0001 function applyoptions(md,data,options_structure)
0002
0003
0004
0005
0006
0007
0008
0009
0010 if ~isnan(options_structure.fontsize),
0011 fontsize=options_structure.fontsize;
0012 else
0013 fontsize=14;
0014 end
0015
0016
0017 if ~isnan(options_structure.fontweight),
0018 fontweight=options_structure.fontweight;
0019 else
0020 fontweight='normal';
0021 end
0022
0023
0024 if ~isnan(options_structure.title),
0025 title(options_structure.title,'FontSize',fontsize,'FontWeight',fontweight);
0026 end
0027
0028
0029 if ~isnan(options_structure.xlabel),
0030 xlabel(options_structure.xlabel,'FontSize',fontsize,'FontWeight',fontweight);
0031 end
0032
0033
0034 if ~isnan(options_structure.ylabel),
0035 ylabel(options_structure.ylabel,'FontSize',fontsize,'FontWeight',fontweight);
0036 end
0037
0038
0039 if ~isnan(options_structure.zlabel),
0040 zlabel(options_structure.zlabel,'FontSize',fontsize,'FontWeight',fontweight);
0041 end
0042
0043
0044 if ~isnan(options_structure.view),
0045 view(options_structure.view);
0046 end
0047
0048
0049 if ~isnan(options_structure.xlim),
0050 xlim(options_structure.xlim);
0051 end
0052
0053
0054 if ~isnan(options_structure.ylim),
0055 ylim(options_structure.ylim);
0056 end
0057
0058
0059 if ~isnan(options_structure.zlim),
0060 zlim(options_structure.zlim);
0061 end
0062
0063
0064 if ~isnan(options_structure.caxis),
0065 caxis(options_structure.caxis);
0066 end
0067
0068
0069 if ~isnan(options_structure.shading),
0070 shading(options_structure.shading);
0071 end
0072
0073
0074 if ~isnan(options_structure.grid) & strcmpi(options_structure.grid,'on'),
0075 grid on;
0076 end
0077
0078
0079 if ~isnan(options_structure.colormap),
0080 h=colormap(options_structure.colormap);
0081 end
0082
0083
0084 if ~isnan(options_structure.wrapping),
0085 if isnan(options_structure.colormap)
0086 h=jet;
0087 end
0088 colormap(repmat(h,options_structure.wrapping,1));
0089 end
0090
0091
0092 if ~isnan(options_structure.colorbar),
0093 if options_structure.colorbar,
0094 c=colorbar;
0095 if ~isnan(options_structure.wrapping)
0096 lim=get(c,'Ylim');
0097 lim=[lim(1) lim(1)+(lim(2)-lim(1))/options_structure.wrapping];
0098 set(c,'Ylim',lim);
0099 end
0100 if ~isnan(options_structure.colorbarpos),
0101 set(c,'Position',options_structure.colorbarpos);
0102 end
0103 elseif ~options_structure.colorbar,
0104 colorbar('off');
0105 end
0106 else
0107 c=colorbar;
0108 if ~isnan(options_structure.wrapping)
0109 lim=get(c,'Ylim');
0110 lim=[lim(1) lim(1)+(lim(2)-lim(1))/options_structure.wrapping];
0111 set(c,'Ylim',lim);
0112 end
0113 if ~isnan(options_structure.colorbarpos),
0114 set(c,'Position',options_structure.colorbarpos);
0115 end
0116 end
0117
0118
0119 if ~isnan(options_structure.axis)
0120 eval(['axis ' options_structure.axis]);
0121 end
0122
0123
0124 if ~isnan(options_structure.area),
0125 antzoom(options_structure.area);
0126 end
0127
0128
0129 if iscell(options_structure.expdisp) | ~isnan(options_structure.expdisp),
0130 for i=1:length(options_structure.expdisp),
0131 filename=options_structure.expdisp{i};
0132 style=options_structure.expstyle{i};
0133 expdisp(filename,gcf,style);
0134 end
0135 end
0136
0137
0138 if ~isempty(options_structure.text)
0139 for i=1:length(options_structure.text);
0140 textstring=options_structure.text{i};
0141 textweight=options_structure.textweight{i};
0142 textsize=options_structure.textsize{i};
0143 textcolor=options_structure.textcolor{i};
0144 textposition=options_structure.textposition{i};
0145 text(textposition(1),textposition(2),textstring,'FontSize',textsize,'FontWeight',textweight,'Color',textcolor);
0146 end
0147 end
0148
0149
0150 if iscell(options_structure.latlon),
0151 latlonoverlay(options_structure.latlon,options_structure.latlonnumbering);
0152 end
0153
0154
0155 if ~isnan(options_structure.northarrow),
0156 northarrow(options_structure.northarrow);
0157 end
0158
0159
0160 if ~isnan(options_structure.scaleruler),
0161 scaleruler(options_structure.scaleruler);
0162 end
0163
0164
0165 if iscell(options_structure.contourlevels) | ~isnan(options_structure.contourlevels),
0166 plot_contour(md,data,options_structure);
0167 end