Changeset 839
- Timestamp:
- 06/08/09 11:16:18 (16 years ago)
- Location:
- issm/trunk/src/m/classes/public/plot
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/classes/public/plot/applyoptions.m
r826 r839 155 155 %latlon 156 156 if (iscell(options_structure.latlon) | ~isnan(options_structure.latlon)), 157 latlonoverlay(options_structure .latlon,options_structure.latlonnumbering);157 latlonoverlay(options_structure); 158 158 end 159 159 -
issm/trunk/src/m/classes/public/plot/latlonoverlay.m
r826 r839 1 function latlonoverlay( latlon,numbering)1 function latlonoverlay(options_structure) 2 2 %LATLONOVERLAY - overlay latitude and longitude lines on current figure 3 3 % … … 8 8 % 9 9 % Usage: 10 % latlonoverlay(latlon,numbering) 10 % latlonoverlay(options_structure) 11 12 %get options 13 latlon=options_structure.latlon; 14 numbering=options_structure.latlonnumbering; 15 if ~isnan(options_structure.latlonclick), 16 latlonclick=1; 17 else 18 latlonclick=0; 19 end 20 if ~isnan(options_structure.fontsize), 21 fontsize=options_structure.fontsize; 22 else 23 fontsize=16; 24 end 11 25 12 26 %recover arguments (set default parameters if needed) … … 84 98 l=line(x,y,'Color',color); 85 99 if numbering, 86 disp(['Specifiy where to put number for longitude ' num2str(lon(i))]); 87 [xcorner,ycorner]=ginput(1); 100 if latlonclick 101 disp(['Specifiy where to put number for longitude ' num2str(lon(i))]); 102 [xcorner,ycorner]=ginput(1); 88 103 89 %Find nearest point on this profile corresponding to (xcorner,ycorner): 90 ind=find_point(x,y,xcorner,ycorner); xcorner=x(ind); ycorner=y(ind); 104 %Find nearest point on this profile corresponding to (xcorner,ycorner): 105 ind=find_point(x,y,xcorner,ycorner); xcorner=x(ind); ycorner=y(ind); 106 else 107 ind=round(9*length(x)/10); xcorner=x(ind); ycorner=y(ind); 108 end 91 109 if length(x(1:ind))>10, 92 110 xcorner2=x(ind-10); ycorner2=y(ind-10); … … 97 115 98 116 if (xcorner>xlimits(1) & xcorner<xlimits(2) & ycorner>ylimits(1) & ycorner<ylimits(2)), 99 th=text(xcorner,ycorner,[num2str(lon(i)) '^{\circ}']);set(th,'Color',colornumber,'Rotation',angle,'FontSize', 16,'HorizontalAlignment','center','VerticalAlignment','middle');117 th=text(xcorner,ycorner,[num2str(lon(i)) '^{\circ}']);set(th,'Color',colornumber,'Rotation',angle,'FontSize',fontsize,'HorizontalAlignment','center','VerticalAlignment','middle'); 100 118 101 119 %erase line and redraw it in two parts, to leave space for latitude number … … 123 141 124 142 if numbering, 125 disp(['Specifiy where to put number for latitude ' num2str(lat(i))]); 126 [xcorner,ycorner]=ginput(1); 143 if latlonclick 144 disp(['Specifiy where to put number for latitude ' num2str(lat(i))]); 145 [xcorner,ycorner]=ginput(1); 127 146 128 %Find nearest point on this profile corresponding to (xcorner,ycorner): 129 ind=find_point(x,y,xcorner,ycorner); xcorner=x(ind); ycorner=y(ind); 147 %Find nearest point on this profile corresponding to (xcorner,ycorner): 148 ind=find_point(x,y,xcorner,ycorner); xcorner=x(ind); ycorner=y(ind); 149 else 150 ind=round(9*length(x)/10); xcorner=x(ind); ycorner=y(ind); 151 end 130 152 if length(x(1:ind))>10, 131 153 xcorner2=x(ind-10); ycorner2=y(ind-10); … … 136 158 137 159 if (xcorner>xlimits(1) & xcorner<xlimits(2) & ycorner>ylimits(1) & ycorner<ylimits(2)), 138 th=text(xcorner,ycorner,[num2str(lat(i)) '^{\circ}']);set(th,'Color',colornumber,'Rotation',angle,'FontSize', 16,'HorizontalAlignment','center','VerticalAlignment','middle');160 th=text(xcorner,ycorner,[num2str(lat(i)) '^{\circ}']);set(th,'Color',colornumber,'Rotation',angle,'FontSize',fontsize,'HorizontalAlignment','center','VerticalAlignment','middle'); 139 161 140 162 %erase line and redraw it in two parts, to leave space for latitude number -
issm/trunk/src/m/classes/public/plot/parse_options.m
r838 r839 559 559 end 560 560 561 %latlonnumbering 562 latlonclickvalues=findarg(optionstring,'latlonclick'); 563 if ~isempty(latlonclickvalues), 564 if strcmpi(latlonclickvalues.value,'on'), 565 options_struct.latlonclick=1; 566 else 567 options_struct.latlonclick=NaN; 568 end 569 else 570 options_struct.latlonclick=NaN; 571 end 572 561 573 %north arrow 562 574 northarrowvalues=findarg(optionstring,'northarrow'); -
issm/trunk/src/m/classes/public/plot/plotdoc.m
r826 r839 95 95 disp(' ''latlon'': ''on'' or {latstep lonstep [resolution [color]]} where latstep,longstep and resolution are in degrees, color is a [r g b] array'); 96 96 disp(' ''latlonnumbering'': ''on'' or {latgap longap colornumber latangle lonangle} where latgap and longap are pixel gaps for the numbers,'); 97 disp(' ''latlonclick'': ''on'' to click on latlon ticks positions'); 97 98 disp(' colornumber is a [r g b] array and latangle and lonangle are angles to flip the numbers'); 98 99 disp(' ''northarrow'': add an arrow pointing north, ''on'' for default value or [x0 y0 length [ratio [width]]] where (x0,y0) are the coordinates of the base, and ratio=headlength/length');
Note:
See TracChangeset
for help on using the changeset viewer.