Histogram Loop Color Issue
Show older comments
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.
Answers (0)
Categories
Find more on Histograms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!