Info
此问题已关闭。 请重新打开它进行编辑或回答。
How to reorder groups and corresponding curves in scatterhist
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!