Changeset 1745


Ignore:
Timestamp:
08/18/09 11:55:04 (16 years ago)
Author:
Mathieu Morlighem
Message:

fixed plot_quiver with colorbar

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

Legend:

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

    r1303 r1745  
    106106%colorbar
    107107if ~isnan(options_structure.colorbar),
    108         if options_structure.colorbar,
     108        %color bar ON
     109        if options_structure.colorbar==1,
    109110                c=colorbar;set(c,'FontSize',fontsize);
    110111                if ~isnan(options_structure.wrapping)
     
    133134                         set(c,'FontSize',fontsize);
    134135                end
    135         elseif ~options_structure.colorbar,
     136        %colorbar OFF
     137        elseif options_structure.colorbar==0,
    136138                colorbar('off');
    137139        end
  • issm/trunk/src/m/classes/public/plot/plot_manager.m

    r1744 r1745  
    127127        options_structure.shading='interp';
    128128end
     129if isquiver & ~strcmpi(options_structure.colorbar,'off'),
     130        options_structure.colorbar=2;
     131end
    129132applyoptions(md,data,options_structure);
  • issm/trunk/src/m/classes/public/plot/plot_quiver.m

    r1744 r1745  
    4444if numcolors==2;
    4545        %blue and red
    46         c=[0 0 1;1 0 0];
     46        c=colormap([0 0 1;1 0 0]);
    4747elseif numcolors==3,
    4848        %blue yellow and red
    49         c=[0 0 1;1 1 0;1 0 0];
     49        c=colormap([0 0 1;1 1 0;1 0 0]);
    5050else
    5151        %let jet choose
     
    6868
    6969%take care of colorbar
    70 if  0 & ~strcmpi(options_structure.colorbar,'off'),
     70if  ~strcmpi(options_structure.colorbar,'off'),
     71        hcb=colorbar('peer',gca,'location','EastOutside');
     72        tickn=cell(1,length(levels));
    7173        for i=1:length(levels),
    72                 scalevalues(i)=levels(i);
    73                 scalestring=[scalestring; sprintf('%8.4g',levels(i))];
     74                tickn{i}=num2str(levels(i));
    7475        end
    75         set(colorbar,'YTickLabel',scalestring,'YTick',scalevalues);
    76         error('debug')
     76        set(hcb,'YTickLabel',tickn,'YTick',1:numcolors+1);
     77        %position
     78        if ~isnan(options_structure.colorbarpos),
     79                set(hcb,'Position',options_structure.colorbarpos);
     80        end
     81        %fontsize
     82        if ~isnan(options_structure.fontsize),
     83                fontsize=options_structure.fontsize;
     84        else
     85                fontsize=14;
     86        end
     87        set(hcb,'FontSize',fontsize);
    7788end
     89
     90%Now no colorbar done by
  • issm/trunk/src/m/classes/public/plot/plotdoc.m

    r1744 r1745  
    8181disp('       ''highres'': resolution of overlayed radar amplitude image (default is 0, high resolution is 1).');
    8282disp('       ''alpha'': transparency coefficient (the higher, the more transparent). Default is 1.5');
     83disp('       ''scaling'': scaling factor used by quiver plots. Default is 0.4');
    8384disp('       ''expdisp'': plot exp file on top of a data plot. provide exp file as an argument (use a cell of strings if more than one)');
    8485disp('       ''expstyle'': marker style for expdisp plot (use a cell of strings if more than one)');
Note: See TracChangeset for help on using the changeset viewer.