Navigation

Operators and Keywords

Function List:

C++ API

colorbar.m File Reference


Functions

 while (i<=nargin) arg
 if (ischar(arg)) if(strcmpi(arg
endif endif elseif (strcmpi(arg,"north")||strcmpi(arg,"south")||strcmpi(arg,"east")||strcmpi(arg,"west")||strcmpi(arg,"northoutside")||strcmpi(arg,"southoutside")||strcmpi(arg,"eastoutside")||strcmpi(arg,"westoutside")) loc
 elseif (strcmpi(arg,"off")||strcmpi(arg,"none")) deleting
endif endwhile if (isempty(ax)) ax
 if (!isempty(cax)) delete(cax)
endif unwind_protect_cleanup set (0,"showhiddenhandles", showhiddenhandles) end_unwind_protect if(!deleting) obj
 set (ax,"activepositionproperty","position","position", pos)
 addproperty ("location", cax,"radio","eastoutside|east|westoutside|west|northoutside|north|southoutside|south", loc)
 addproperty ("axes", cax,"handle", ax)
 if (vertical) hi
 if (mirror) set(cax
else set (cax,"xtick",[],"xdir","normal","ydir","normal","ylim", cext,"ylimmode","manual","yaxislocation","left", args{:})
else set (cax,"ytick",[],"xdir","normal","ydir","normal","xlim", cext,"xlimmode","manual","xaxislocation","bottom", args{:})
endif endif if (!isnan(aspect)) set(cax
 set (cax,"deletefcn",{@resetaxis, orig_pos, orig_opos})
 addlistener (ax,"clim",{@update_colorbar_clim, hi, vertical}) addlistener(ax
endif endfunction function deletecolorbar (h, d, hc, pos, opos) if(ishandle(hc)&&strcmp(get(hc
endif endfunction function axes && isempty (gcbf())||strcmp(get(gcbf()
endif endfunction function axes off if (strcmp(get(hc,"beingdeleted"),"off")) delete(hc)
endif if (!isempty(ancestor(h,"axes"))&&strcmp(get(ancestor(h,"axes"),"beingdeleted"),"off")) set(ancestor(h
endif endif endfunction function resetaxis (h, d, pos, opos) if(ishandle(h)&&strcmp(get(h
endif endif endfunction
function axes off && 
ishandle (get(h,"axes"))) set(get(h
endif endfunction function update_colorbar_clim (h, d, hi, vert) if(ishandle(h)&&strcmp(get(h
 if (vert) set(hi
 set (get(hi,"parent"),"ylim", cext)
else set (hi,"xdata",[cmin, cmax])
 set (get(hi,"parent"),"xlim", cext)
endif endif endfunction function update_colorbar_axis (h, d, cax) if(ishandle(cax)&&strcmp(get(cax
else set (cax,"xtick",[],"xdir","normal","ydir","normal","yaxislocation","left","position", cpos)
else set (cax,"ytick",[],"xdir","normal","ydir","normal","xaxislocation","bottom","position", cpos)
 if (strcmpi(obj.dataaspectratiomode,"manual")) r
 if (pos(3) > pos(4)) switch(cbox) case
endswitch else switch (cbox) case
 pos (4)=0.8 *pos(4)
 pos (2)
 pos (3)=0.8 *pos(3)
 pos (1)
 if (strfind(cbox,"outside")) scale
endif if (sz(1) > sz(2)) dx
 cpos (1)
 cpos (3)
 cpos (2)
 cpos (4)
 !imagesc (x)%!colorbar()
!demo!clf !contour (peaks())%!colorbar("west")
!demo!clf !subplot (2, 2, 1)%!contour(peaks())%!colorbar("east")
 !subplot (2, 2, 2)%!contour(peaks())%!colorbar("west")
 !subplot (2, 2, 3)%!contour(peaks())%!colorbar("north")
 !subplot (2, 2, 4)%!contour(peaks())%!colorbar("south")
 !subplot (1, 2, 1)%!imagesc(x)%!axis square
 !colorbar ()
 !subplot (1, 2, 2)%!imagesc(x)%!axis square
 !colorbar ("westoutside")
 !colorbar ("northoutside")
 !colorbar ("southoutside")
 !subplot (2, 1, 1)%!imagesc(x)%!axis square
 !subplot (2, 1, 2)%!imagesc(x)%!axis square
 !colorbar ("east")
 !xlim ([1, 64])%!ylim([1
 !contour (x)%!xlim([1
 !ylim ([1, 64])%!colorbar()
!demo!clf !imagesc (1./hilb(99))
 !set (h, 'yscale', 'log')
!demo!clf !imagesc (log10(1./hilb(99)))
 !set (h,"yticklabel", sprintf('10^{%g}|', ytick))
 !imagesc (1./hilb(n))
 !imagesc (x, y, 1./hilb(n))
 !imagesc (y, x, 1./hilb(n))
colorbar!demo!clf!axes!colorbar!hold
on 
!contour (peaks)%!hold off%!demo%!clf%!plot([0
colorbar!demo!clf!axes!colorbar!hold
on 
!colorbar ("eastoutside")%!axis square%!demo%!clf%!plot([0

Variables

function h
 loc = "eastoutside"
 args = {}
 deleting = false
 i = 1
peer if(i > nargin) error("colorbar
else 
ax
endif showhiddenhandles = get (0, "showhiddenhandles")
unwind_protect set (0,"showhiddenhandles","on") cax = findobj (get (ax, "parent"), "tag", "colorbar", "type", "axes", "axes", ax)
 position = obj.position
 clen = rows (get (get (ax, "parent"), "colormap"))
 cext = get (ax, "clim")
 cdiff = (cext(2) - cext(1)) / clen / 2
 cmin = cext(1) + cdiff
 cmax = cext(2) - cdiff
 orig_pos = obj.position
 orig_opos = obj.outerposition
 cax
 xtick
 xdir
 normal
 ydir
 ylim
 ylimmode
 manual
 yaxislocation
 right = find (def(1:right-1) != " ", 1, "last")
endif else hi = image (cax, [cmin, cmax], [0,1], [1 : clen])
 ytick
 xlim
 xlimmode
 xaxislocation
 top
endif endif dataaspectratio
endif endif aspect = NaN
endif ctext
endif endfunction function type
endif endfunction function axes && beingdeleted
endif axes
endif pos
endif outerposition
endif opos
 ydata
 obj = get (h)
 cpos = [origin, sz]
endif endif endfunction function [pos, cpos, vertical, mirr, aspect]
 sz = pos(3:4)
 off = 0
 mirr = true
 vertical = false
case north origin = pos(1:2) + [0.05, 0.9] .* sz + [1, -1] .* off
 actual_pos = __actual_axis_position__ (obj)
else scale = 0.9
else dy = (1-scale)*actual_pos(4)
endif endfunction!demo!clf !n = 64
 x = kron (1:n,ones(n,1))
 !h = colorbar
 !ytick = get(h, "ytick")
 y = linspace(0,1,n)
axis equal

Function Documentation

colorbar !demo ! clf ! axes ! colorbar ! hold on !colorbar ( "eastoutside"   ) 

!colorbar ( "east"   ) 

!colorbar ( "southoutside"   ) 

!colorbar ( "northoutside"   ) 

!colorbar ( "westoutside"   ) 

!colorbar (  ) 

colorbar !demo ! clf ! axes ! colorbar ! hold on !contour ( peaks   ) 

!contour (  ) 

!demo ! clf !contour ( peaks()   ) 

!imagesc ( ,
,
1./  hilbn 
)

!imagesc ( ,
,
1./  hilbn 
)

!imagesc ( 1./  hilbn  ) 

!demo ! clf !imagesc ( log10(1./hilb(99))   ) 

!demo ! clf !imagesc ( 1./  hilb99  ) 

!imagesc (  ) 

!set ( ,
"yticklabel"  ,
sprintf('10^{%g}|', ytick  
)

!set ( ,
'yscale'  ,
'log'   
)

!subplot ( ,
,
 
)

!subplot ( ,
,
 
)

!subplot ( ,
,
 
)

!subplot ( ,
,
 
)

!subplot ( ,
,
 
)

!subplot ( ,
,
 
)

!subplot ( ,
,
 
)

!demo ! clf !subplot ( ,
,
 
)

!xlim (  ) 

!ylim (  ) 

addlistener ( ax  ,
"clim"   
)

addproperty ( "axes"  ,
cax  ,
"handle"  ,
ax   
)

addproperty ( "location"  ,
cax  ,
"radio"  ,
"eastoutside|east|westoutside|west|northoutside|north|southoutside|south"  ,
loc   
)

cpos (  ) 

cpos (  ) 

cpos (  ) 

cpos (  ) 

endif endfunction function deletecolorbar ( ,
,
hc  ,
pos  ,
opos   
)

Type Constraints

elseif ( strcmpi(arg,"off")||strcmpi(arg,"none")   ) 

endif endif elseif ( strcmpi(arg,"north")||strcmpi(arg,"south")||strcmpi(arg,"east")||strcmpi(arg,"west")||strcmpi(arg,"northoutside")||strcmpi(arg,"southoutside")||strcmpi(arg,"eastoutside")||strcmpi(arg,"westoutside")   ) 

endif if ( sz(1)  ,
sz(2)   
)

if ( strfind(cbox,"outside")   ) 

if ( pos(3)  ,
pos(4)   
)

if ( strcmpi(obj.dataaspectratiomode,"manual")   ) 

if ( vert   ) 

endif if ( isemptyancestor(h,"axes"))&&strcmp(get(ancestor(h,"axes"),"beingdeleted"),"off"  ) 

endif endfunction function axes off if ( strcmp(get(hc,"beingdeleted"),"off")   ) 

Type Constraints

endif endif if ( isnanaspect  ) 

if ( mirror   ) 

if ( vertical   ) 

if ( isemptycax  ) 

endif endwhile if ( isempty(ax)   ) 

if ( ischar(arg)   ) 

endif endif endfunction function axes && isempty ( gcbf()   ) 

Type Constraints

endif endif endfunction function axes off&& ishandle ( get(h,"axes")   ) 

Type Constraints

pos (  ) 

pos (  )  [pure virtual]

pos (  ) 

pos (  )  [pure virtual]

endif endif endfunction function resetaxis ( ,
,
pos  ,
opos   
)

else set ( cax  ,
"ytick"  ,
"xdir"  ,
"normal"  ,
"ydir"  ,
"normal"  ,
"xaxislocation"  ,
"bottom"  ,
"position"  ,
cpos   
)

else set ( cax  ,
"xtick"  ,
"xdir"  ,
"normal"  ,
"ydir"  ,
"normal"  ,
"yaxislocation"  ,
"left"  ,
"position"  ,
cpos   
)

set ( get(hi,"parent")  ,
"xlim"  ,
cext   
)

else set ( hi  ,
"xdata"   
)

set ( get(hi,"parent")  ,
"ylim"  ,
cext   
)

Type Constraints

set ( cax  ,
"deletefcn"   
)

else set ( cax  ,
"ytick"  ,
"xdir"  ,
"normal"  ,
"ydir"  ,
"normal"  ,
"xlim"  ,
cext  ,
"xlimmode"  ,
"manual"  ,
"xaxislocation"  ,
"bottom"   
)

Type Constraints

else set ( cax  ,
"xtick"  ,
"xdir"  ,
"normal"  ,
"ydir"  ,
"normal"  ,
"ylim"  ,
cext  ,
"ylimmode"  ,
"manual"  ,
"yaxislocation"  ,
"left"   
)

Type Constraints

set ( ax  ,
"activepositionproperty"  ,
"position"  ,
"position"  ,
pos   
)

endif unwind_protect_cleanup set ( ,
"showhiddenhandles"  ,
showhiddenhandles   
)

endswitch else switch ( cbox   ) 

endif endif endfunction function update_colorbar_axis ( ,
,
cax   
)

endif endfunction function update_colorbar_clim ( ,
,
hi  ,
vert   
)

while ( i<=  nargin  ) 


Variable Documentation

!h = colorbar

colorbar !demo ! clf !n = 64

!ytick = get(h, "ytick")

actual_pos = __actual_axis_position__ (obj)

args = {}

peer if (i > nargin) error ("colorbar else ax

Initial value:

 vargin{i++}
          if (!isscalar (ax) || ! ishandle (ax)
              || strcmp (get (ax, "type"), "axes"))
            error ("colorbar: expecting an axes handle following \"peer\"")

cax

Initial value:

 __go_axes__ (get (ax, "parent"), "tag", "colorbar", 
                       "handlevisibility", "on", 
                       "activepositionproperty", "position", 
                       "position", cpos)

cdiff = (cext(2) - cext(1)) / clen / 2

cext = get (ax, "clim")

endif endfunction function image off clen = rows (get (get (ax, "parent"), "colormap"))

cmax = cext(2) - cdiff

cmin = cext(1) + cdiff

endswitch cpos = [origin, sz]

Initial value:

 text (0, 0, "", "tag", "colorbar","visible", "off", 
                  "handlevisibility", "off", "xliminclude", "off",  
                  "yliminclude", "off", "zliminclude", "off",
                  "deletefcn", {@deletecolorbar, cax, orig_pos, orig_opos})

deleting = false

else dy = (1-scale)*actual_pos(4)

axis equal

Initial value:

 __position_colorbox__ (cbox, obj, cf)

  pos = obj.position

Initial value:

 colorbar (varargin)
  ax = []

endif else hi = image (cax, [cmin, cmax], [0,1], [1 : clen])

i = 1

mirr = true

obj = get (h)

case west origin = pos(1:2) + [0.05, 0.9] .* sz + [1, -1] .* off

endif right = find (def(1:right-1) != " ", 1, "last")

else scale = 0.9

unwind_protect set(0,"showhiddenhandles","on") cax = findobj (get (ax, "parent"), "tag", "colorbar", "type", "axes", "axes", ax)

endif showhiddenhandles = get (0, "showhiddenhandles")

sz = pos(3:4)

vertical = false

x = kron (1:n,ones(n,1))

y = linspace(0,1,n)