Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

How to reorder groups and corresponding curves in scatterhist

1 vue (au cours des 30 derniers jours)
Ali Y.
Ali Y. le 24 Juin 2016
Clôturé : MATLAB Answer Bot le 20 Août 2021
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..')

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by