How to preserve colors in histogram2
1 次查看(过去 30 天)
显示 更早的评论
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.
Thank you in advance
Kostas
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Distribution Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!