Changeset 826 for issm/trunk


Ignore:
Timestamp:
06/05/09 16:10:57 (16 years ago)
Author:
Mathieu Morlighem
Message:

some fixing in latlon

Location:
issm/trunk/src/m/classes/public/plot
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/public/plot/applyoptions.m

    r27 r826  
    154154
    155155%latlon
    156 if iscell(options_structure.latlon),
     156if (iscell(options_structure.latlon) | ~isnan(options_structure.latlon)),
    157157        latlonoverlay(options_structure.latlon,options_structure.latlonnumbering);
    158158end
  • issm/trunk/src/m/classes/public/plot/latlonoverlay.m

    r1 r826  
    1010%      latlonoverlay(latlon,numbering)
    1111
    12 %recover latstep and longstep
    13 latstep=latlon{1};
    14 lonstep=latlon{2};
    15 resolution=latlon{3};
    16 color=latlon{4};
     12%recover arguments (set default parameters if needed)
     13%1: latlon
     14if ~iscell(latlon),
     15        latstep=3;
     16        lonstep=3;
     17        resolution=0.1;
     18        color=[1 1 1];
     19else
     20        if length(latlon)<2
     21                error('latlonoverlay error message: at least 2 arguments are required, or use ''on'' option.');
     22        end
     23        if length(latlon)==2,
     24                latstep=latlon{1};
     25                lonstep=latlon{2};
     26                resolution=0.1;
     27                color=[1 1 1];
     28        elseif length(latlon)==3,
     29                latstep=latlon{1};
     30                lonstep=latlon{2};
     31                resolution=latlon{3};
     32                color=[1 1 1];
     33        else
     34                latstep=latlon{1};
     35                lonstep=latlon{2};
     36                resolution=latlon{3};
     37                color=latlon{4};
     38        end
     39end
    1740
    18 if ~iscell(numbering),
     41%2: numbering
     42if ~iscell(numbering) & isnan(numbering),
    1943        numbering=0;
    2044else
    21         latgap=numbering{1};
    22         longap=numbering{2};
    23         colornumber=numbering{3};
    24         latangle=numbering{4};
    25         lonangle=numbering{5};
    26         numbering=1;
     45        if ~iscell(numbering),
     46                if strcmpi(char(numbering),'on'),
     47                        latgap=2;
     48                        longap=2;
     49                        colornumber=[1 1 1];
     50                        latangle=0;
     51                        lonangle=0;
     52                        numbering=1;
     53                else
     54                        numbering=0;
     55                end
     56        else
     57                latgap=numbering{1};
     58                longap=numbering{2};
     59                colornumber=numbering{3};
     60                latangle=numbering{4};
     61                lonangle=numbering{5};
     62                numbering=1;
     63        end
    2764end
    2865
  • issm/trunk/src/m/classes/public/plot/plot_overlay.m

    r819 r826  
    6060
    6161%Apply options, without colorbar and without grid
     62iscolorbar=(options_structure.colorbar==1 | isnan(options_structure.colorbar));
    6263options_structure.colorbar=0;
    6364
     
    6566
    6667%colorbar
    67 if options_structure.colorbar,
     68if iscolorbar,
    6869
    6970        %create colorbar with correct colors and position
     
    7273        colorbar_image_handle=get(colorbar_handle,'Children');
    7374        set(colorbar_image_handle,'CData',colorbar_rgb);
    74         if options_structure.colorbarpos,
     75        if ~isnan(options_structure.colorbarpos),
    7576                set(colorbar_handle,'Position',options_structure.colorbarpos);
     77        else
     78                set(colorbar_handle,'Position',[0.82 0.65 0.03 0.2])
    7679        end
    7780
     
    8891        for i=1:numvalues,
    8992                fraction=(scalevalues(i)-scaleminmax(1))/(scaleminmax(2)-scaleminmax(1));
    90                 scalevalues(i)=exp(min(log(data))+(max(log(data))-min(log(data)))*fraction);
    91 
     93                scalevalues(i)=round_ice(exp(min(log(data))+(max(log(data))-min(log(data)))*fraction),1);
    9294                scalestring=[scalestring; sprintf('%8.4g',scalevalues(i))];
    9395        end
    9496        set(colorbar_handle,'YTickLabel',scalestring);
    9597        set(colorbar_handle,'YColor','y');
    96         set(colorbar_handle,'FontSize',16);
     98        set(colorbar_handle,'FontSize',14);
    9799end
    98100
  • issm/trunk/src/m/classes/public/plot/plotdoc.m

    r345 r826  
    9393disp('       ''designvariable'': name of design variable for importance factors');
    9494disp('       ''responsefunction'': name of response function for importance factors');
    95 disp('       ''latlon'': {latstep lonstep resolution color} where latstep,longstep and resolution are in degrees, color is a [r g b] array');
    96 disp('       ''latlonnumbering'': {latgap longap colornumber latangle lonangle} where latgap and longap are pixel gaps for the numbers,');
     95disp('       ''latlon'': ''on'' or {latstep lonstep [resolution [color]]} where latstep,longstep and resolution are in degrees, color is a [r g b] array');
     96disp('       ''latlonnumbering'': ''on'' or {latgap longap colornumber latangle lonangle} where latgap and longap are pixel gaps for the numbers,');
    9797disp('                   colornumber is a [r g b] array and latangle and lonangle are angles to flip the numbers');
    9898disp('       ''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.