applyoptions

PURPOSE ^

APPLYOPTIONS - apply the options to current plot

SYNOPSIS ^

function applyoptions(md,data,options_structure)

DESCRIPTION ^

APPLYOPTIONS - apply the options to current plot

   Usage:
      applyoptions(md,data,options_structure)

   See also: PLOTMODEL, PARSE_OPTIONS

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function applyoptions(md,data,options_structure)
0002 %APPLYOPTIONS - apply the options to current plot
0003 %
0004 %   Usage:
0005 %      applyoptions(md,data,options_structure)
0006 %
0007 %   See also: PLOTMODEL, PARSE_OPTIONS
0008 
0009 %fontsize
0010 if ~isnan(options_structure.fontsize),
0011     fontsize=options_structure.fontsize;
0012 else
0013     fontsize=14;
0014 end
0015 
0016 %fontweight
0017 if ~isnan(options_structure.fontweight),
0018     fontweight=options_structure.fontweight;
0019 else
0020     fontweight='normal';
0021 end
0022 
0023 %title
0024 if ~isnan(options_structure.title),
0025     title(options_structure.title,'FontSize',fontsize,'FontWeight',fontweight);
0026 end
0027 
0028 %xlabel
0029 if ~isnan(options_structure.xlabel),
0030     xlabel(options_structure.xlabel,'FontSize',fontsize,'FontWeight',fontweight);
0031 end
0032 
0033 %ylabel
0034 if ~isnan(options_structure.ylabel),
0035     ylabel(options_structure.ylabel,'FontSize',fontsize,'FontWeight',fontweight);
0036 end
0037 
0038 %zlabel
0039 if ~isnan(options_structure.zlabel),
0040     zlabel(options_structure.zlabel,'FontSize',fontsize,'FontWeight',fontweight);
0041 end
0042 
0043 %view
0044 if ~isnan(options_structure.view),
0045     view(options_structure.view);
0046 end
0047 
0048 %xlim
0049 if ~isnan(options_structure.xlim),
0050     xlim(options_structure.xlim);
0051 end
0052 
0053 %ylim
0054 if ~isnan(options_structure.ylim),
0055     ylim(options_structure.ylim);
0056 end
0057 
0058 %zlim
0059 if ~isnan(options_structure.zlim),
0060     zlim(options_structure.zlim);
0061 end
0062 
0063 %Caxis
0064 if ~isnan(options_structure.caxis),
0065     caxis(options_structure.caxis);
0066 end
0067 
0068 %shading
0069 if ~isnan(options_structure.shading),
0070     shading(options_structure.shading);
0071 end
0072 
0073 %grid
0074 if ~isnan(options_structure.grid) & strcmpi(options_structure.grid,'on'),
0075     grid on;
0076 end
0077 
0078 %colormap
0079 if ~isnan(options_structure.colormap),
0080     h=colormap(options_structure.colormap);
0081 end
0082 
0083 %wrapping
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 %colorbar
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 %axis
0119 if ~isnan(options_structure.axis)
0120     eval(['axis ' options_structure.axis]);
0121 end
0122 
0123 %area
0124 if ~isnan(options_structure.area),
0125     antzoom(options_structure.area);
0126 end
0127 
0128 %expdisp
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 %text (default value is empty, not NaN...)
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 %latlon
0150 if iscell(options_structure.latlon),
0151     latlonoverlay(options_structure.latlon,options_structure.latlonnumbering);
0152 end
0153 
0154 %north arrow
0155 if ~isnan(options_structure.northarrow),
0156     northarrow(options_structure.northarrow);
0157 end
0158 
0159 %Scale ruler
0160 if ~isnan(options_structure.scaleruler),
0161     scaleruler(options_structure.scaleruler);
0162 end
0163 
0164 %contours
0165 if iscell(options_structure.contourlevels) | ~isnan(options_structure.contourlevels),
0166     plot_contour(md,data,options_structure);
0167 end

Generated on Sun 29-Mar-2009 20:22:55 by m2html © 2003