Horizontal Histograms Matlab

Many horizontal histograms Matlab. Here's the code and plots.

if FlagH == 1
    prob = prob(:,1:2:end);
    [prob,x] = hist(prob,20);
    x = 1 : size(prob,1);
else
    prob = prob(:,1:2:end);
    x = 1 : size(prob,1);
end

% figure;
ma = axes('Position',[.1 .1 .8 .8] );  % "parent" axes

N = size(prob,2); % Number of vertical bars

for ii = 1:N
    % create an axes inside the parent axes for the ii-the barh
    sa = axes('Position', [0.1+(ii-1)*.8/N, .1, .8/N, .9]); % position the ii-th barh
    h = barh(x, prob(:,ii), 'Parent', sa);
    bl = get(h,'BaseLine');
    set(bl,'Color',[1 1 1]*204/256)
    axis off;
end

No comments:

Post a Comment