function r = rvmccamake(cca, green_val, yellow_val, red_val, titles, subsets, ref) %RVMCCAMAKE Generates a colorimetric comparison array for ratio of vector magnitudes % RVMCCAMAKE(cca, green_val, yellow_val, red_val, titles, subsets, ref) plots a % CCA using the limit values passed. Color values come from the contents of % the argument cca. The fifth and sixth arguments (titles, subsets) are % optional cell arrays of strings that can be used to label the CCA (though % if only one is given, the program assumes it is a titles cell array). These % cell arrays should match the dimensions of the array to be generated, i.e. % # of strings in titles = # of columns in cca and # of strings in subsets = # % of rows in cca. The last argument is an optional string describing the reference % profile. The actual numerical value for green_val can be greater than % or less than red_val, however the yellow_val must lie in between both numbers. % Colors are generated used the function profilecolors.m which uses two-sided % linear interpolation about yellow_val where values outside the green-yellow % range are assigned boundary values. A legend specific for ratios of vector % magnitudes is generated at the bottom of the CCA. % % Written by Finny Kuruvilla, v1.4.2 Last updated 10-25-2000 sp = 2.5; % Defines the amount of space between circles c = [.8 .8 .8]; % Background color ([.8 .8 .8] = grey) lx = 5; % legend x coordinate offset (in # of columns) red_legend = 'increased magnitude'; % legend descriptor for red_val yellow_legend = 'unchanged magnitude'; % yellow_val green_legend = 'decreased magnitude'; % green_val lift_y = .1; % sets text legend offset above being flush % bottom box_width = 12; % box width for the legend (in columns) box_height = 4; % box height for the legend (in columns) ccapos = [.13 0.001 .7 .75]; % to set the positioning of the CCA in the window r = figure; axis off; grid off; hold on; set(gcf,'Color',c); [rows,cols] = size(cca); x = cos([0:10:360]*(pi/180)); y = sin([0:10:360]*(pi/180)); for j=1:rows for k=1:cols fill(x+sp*k,y-sp*j,profilecolors(green_val,yellow_val,red_val,cca(j,k))); end end fill(x+sp*lx,y-sp*(j+2),profilecolors(green_val,yellow_val,red_val,red_val)); text(sp*(lx+1),-sp*(j+2-lift_y),red_legend); fill(x+sp*lx,y-sp*(j+3),profilecolors(green_val,yellow_val,red_val,yellow_val)); text(sp*(lx+1),-sp*(j+3-lift_y),yellow_legend); fill(x+sp*lx,y-sp*(j+4),profilecolors(green_val,yellow_val,red_val,green_val)); text(sp*(lx+1),-sp*(j+4-lift_y),green_legend); rectangle('Position',[sp*(lx-1) -sp*(j+5) sp*box_width sp*box_height]); if (nargin > 4) for k=1:cols txt_hand = text(sp*k,0,titles(k)); set(txt_hand,'Rotation',[45]); end if (nargin > 5) for j=1:rows txt_hand = text(sp*(k+1),-sp*j,subsets(j)); set(txt_hand,'HorizontalAlignment','left'); end end if (nargin > 6) txt_hand = text(-sp, -2*sp*j/3, ref); set(txt_hand,'Rotation',[90]); end axis('equal'); set(gca,'Position', ccapos) else axis('equal'); end