how to make a transparent histogram in matlab

how to make a transparent histogram in matlab



to make a partially transparent histogram in matlab, use the facealpha setting.

for instance, the following code produces the histogram seen above:

figure
hist(data1,20)
h = findobj(gca,’Type’,'patch’);
set(h,’FaceColor’,'r’,'EdgeColor’,'w’,'facealpha’,0.75)
hold on
hist(data2,20)
h = findobj(gca,’Type’,'patch’);
set(h,’facealpha’,0.75);
ylabel(‘counts’)
xlabel(‘gene-tree-length/species-tree-length’)
legend(‘no HGT’,'HGT’)
title(‘p = 0.5′);

你可能感兴趣的:(how to make a transparent histogram in matlab)