'histfit': change line color

36 views (last 30 days)
dd
dd on 13 Jun 2012
Hi, does anyone know how to change color and linestyle in 'histfit'? cheers

Accepted Answer

Tom Lane
Tom Lane on 13 Jun 2012
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.
  2 Comments
Oznur Mete
Oznur Mete on 4 Dec 2014
Thank you very much both histfit function and this tip are extremely useful!

Sign in to comment.

More Answers (0)

Categories

Find more on Graphics Object Programming in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!