由於我不太喜歡Matlab的極座標繪圖儀,我通常將它們寫成笛卡爾座標系。所以說,你是存儲每一項(計數,色調,飽和度)的列向量:基於在z
hue = floor(rand(1000,1) * 361);
saturation = floor(rand(1000,1) * 100);
vals = [hue, saturation];
sorted = sortrows(vals);
[C, ia, ic] = unique(sorted, 'rows');
counts = diff(ia);
counts(end + 1) = ia(end) - length(vals) + 1;
% Not a big fan of this method so changed to find counts
% by pre-sorting and then using the index
%[C, ia , ic] = unique(vals, 'rows');
%counts = zeros(length(C), 1);
%for x = 1:length(C)
% counts(x) = numel(find(vals(:,1) == C(x,1) & vals(:,2) == C(x,2)));
%end
x = C(:,2) .* cos(pi*C(:,1)/180);
y = C(:,2) .* sin(pi * C(:,1)/180);
plot3(x, y, counts, '.')
有一種方法來改變顏色:
hue = 90;
saturation = 50;
count = 250;
x = saturation * cos(pi * hue/180);
y = saturation * cos(pi * hue/180);
plot3(x, y, count, '.')
對於一個更實際的例子價值,如果你想要,但會變得更復雜一點。您可以使用網格網格和輪廓或http://www.mathworks.com/matlabcentral/fileexchange/14677此文件將繪製它。
你試過用玫瑰嗎? – Daniel
在你原來的問題中,圖像沒有鏈接,Erik以某種方式注意到隱藏的鏈接並修復了它。有了這些信息,我不認爲'玫瑰'是正確的選擇。 – Daniel
我投票重新提出這個問題,現在很清楚你想要什麼。 – Daniel