フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to reorder groups and corresponding curves in scatterhist

1 回表示 (過去 30 日間)
Ali Y.
Ali Y. 2016 年 6 月 24 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I have the following script aiming to show my data by scatterhist, properly. But it gives an awkward y-histogram, as it seems in the 'scatterhist' the curve correspond to the least frequent occurrences is plotted at the end; I mean in order. So, curves corresponding to more frequent occurrences are suppressed and do not illustrated properly. How can I fix my code.
p= 1:100;
z= zeros(1,2);
n= -1:-1:-40;
a = [z,p,n];
c={zeros(numel(a)),1};
for i= 1:numel(a)
if a(i)>0
c(i)={'p'};
elseif a(i)==0
c(i)= {'z'};
elseif a(i)<0
c(i)={'n'};
end
end
figure(1)
scatterhist(rand(1,numel(a)),a,'Group',char(c),'Marker','s..')

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by