Histogram Loop Color Issue

1 次查看(过去 30 天)
AR
AR 2022-5-5
评论: AR 2022-5-5
Help with keeping my two colors on each histogram.
Each of k-histograms below have two two different colors plotted, orange for neurons=<800 and blue>800. For some reason, on the second k-loop, the colors for both plots default to just blue. I've attached my data, 5x2036 double. Each row in attached matrix, produces each k-histogram in code below.
figure(103) % NEURON POPULTATION SPIKE COUNTS, DURING LAST 2000 ms
nBinsN=(800-1)+1; % number of neuron bins
for k=1:size(sendersSp,1)
subplot(1,size(sendersSp,1),k)
histogram(sendersSp(1,(sendersSp(k,:)<=800)),nBinsN,'FaceColor',[0.9290 0.6940 0.1250],'EdgeColor',[0.9290 0.6940 0.1250],'EdgeAlpha',0.3,'BinMethod','integers')
ylabel('spike count');
xlabel('neuron #');
title(['Pttrn ',num2str(k),' Spikes']);
hold on
histogram(sendersSp(1,(sendersSp(k,:)>800)),nBinsN,'FaceColor',[0 0.4470 0.7410],'EdgeColor',[0 0.4470 0.7410],'EdgeAlpha',0.3,'BinMethod','integers')
hold off
end
Appreciate any suggestions to maintain two colors on each k-histogram. Thank you.
  1 个评论
AR
AR 2022-5-5
just found my error:
histogram(sendersSp(1,(sendersSp(k,:)<=800))...
should be written as
histogram(sendersSp(k,(sendersSp(k,:)<=800))

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Histograms 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by