How to preserve colors in histogram2

조회 수: 1 (최근 30일)
Kostas
Kostas 2018년 11월 21일
편집: Image Analyst 2018년 11월 21일
Hello all,
i try to plot 5 datasets using histogram2 and hold on. I realize that the colors are not preserved (colors not showing correctly the number of points, see below for a better explanation). It looks like an overlapping issue.
Below is the piece of cde used in a loop to plot all 5 datasets.
for i2=1:5
lonf = data(:,i2);
latf = data1(:,i2);
subplot(ax2), histogram2(lonf,latf,'BinWidth',[10 5],'FaceColor',nco(i2,:),...
'EdgeColor',nco(i2,:));hold(ax2,'on')
end
where: nco=new color order from matlab and
latf and lonf are read each time in the loop
In the attached figure, you see the edges which delimitate different datasets. For example, there is a blue edge in the green bar. The color below the blue edge should have been blue, etc but it's green. I would appreciate any help for solving this issue.
image003.jpg
Thank you in advance
Kostas

답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by