MATLAB: ‘histfit’: change line color

histfit

Hi, does anyone know how to change color and linestyle in 'histfit'? cheers

Best Answer

h = histfit(randn(100,1));
set(h(1),'facecolor','g'); set(h(2),'color','m')
Changing other properties is similar. Just remember h(1) is a patch and h(2) is a line.