Changeset 6187


Ignore:
Timestamp:
10/08/10 05:53:26 (15 years ago)
Author:
Eric.Larour
Message:

Added colorbarwidth and colorbarheight options.

Location:
issm/trunk/src/m/model/plot
Files:
2 edited

Legend:

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

    r6167 r6187  
    163163                axes(backup);
    164164        end
    165         %colorbar OFF
     165        if exist(options,'colorbarwidth'),
     166                posaxes=get(gca,'Position');
     167                alpha=getfieldvalue(options,'colorbarwidth',1);
     168                position=get(c,'Position');
     169                dx=position(3);
     170                newdx=dx*alpha;
     171                position(1)=position(1)+(dx-newdx)/2;
     172                position(3)=newdx;
     173                set(c,'Position',position);
     174                set(gca,'Position',posaxes);
     175        end
     176        if exist(options,'colorbarheight'),
     177                posaxes=get(gca,'Position');
     178                alpha=getfieldvalue(options,'colorbarheight',1);
     179                position=get(c,'Position');
     180                dy=position(4);
     181                newdy=dy*alpha;
     182                position(2)=position(2)+(dy-newdy)/2;
     183                position(4)=newdy;
     184                set(c,'Position',position);
     185                set(gca,'Position',posaxes);
     186        end
     187
     188
    166189elseif getfieldvalue(options,'colorbar',1)==0,
    167190        colorbar('off');
     
    169192        %do nothing
    170193end
     194
    171195
    172196%area
  • issm/trunk/src/m/model/plot/plotdoc.m

    r6134 r6187  
    6262disp('       ''colorbartitlerotation'': -90, etc ...');
    6363disp('       ''colorbarfontsize'': specify colorbar fontsize');
     64disp('       ''colorbarwidth'': multiplier (default 1) to the default width colorbar');
     65disp('       ''colorbarheight'': multiplier (default 1) to the default height colorbar');
    6466disp('       ''colormap'': same as standard matlab option (''jet'',''HSV'',''cool'',''spring'',''gray'',...)');
    6567disp('       ''contourlevels'': N or {value1,valu2,value3,...} add the contours of the specified values or N contours');
Note: See TracChangeset for help on using the changeset viewer.