How to preserve colors in histogram2

1 visualización (últimos 30 días)
Kostas
Kostas el 21 de Nov. de 2018
Editada: Image Analyst el 21 de Nov. de 2018
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

Respuestas (0)

Categorías

Más información sobre Data Distribution Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by