function viewMixPartition(partition, popnames) notEmptyPops = length(unique(partition)); if notEmptyPops>30 disp(['Number of populations: ' num2str(notEmptyPops)]); disp(' '); disp('Figure can be drawn only if the number of populations'); disp('is less or equal to 30.'); disp(' '); return; end nind = length(partition); %npops = max(partition); npops = notEmptyPops; varit = giveColors(npops); korkeinviiva = 1.05; pieninarvo = -korkeinviiva; h0 = figure; set(h0, 'NumberTitle', 'off'); %image_figure; %Muutettu tiedot.popnames = popnames; tiedot.info = partition; set(h0,'UserData',tiedot); set(gca, 'Xlim', [-.5 ,nind+.5], 'YLim', [pieninarvo ,korkeinviiva], ... 'XTick', [], 'XTickLabel', [], 'YTick', [], 'YTickLabel', []); eiTyhjatPopulaatiot = unique(partition); for i=1:nind % Suhteellisten osuuksien laskeminen pop = partition(i); pop = find(eiTyhjatPopulaatiot==pop); % Pylvään piirtäminen h0 =patch([i-1, i, i, i-1], [0, 0, 1, 1], varit(pop,:)); set(h0,'EdgeColor','none'); % Midevaa varten kommentoitava! end if ~isempty(popnames) npops = size(popnames,1); for i=1:npops firstInd = popnames{i,2}; if size(popnames,1) ~=nind line([firstInd-1, firstInd-1], [0,1], 'Color', 'k'); %Populaatioiden rajat end if i