Add multiple hist fit to a figure, without the hist

11,024

h = histfit(...) returns a vector of handles h, where h(1) is the handle to the histogram and h(2) is the handle to the fitted curve.

use delete(h(1)) to delete the histogram.

If you didn't assign a handle to the fitted histo, you can retrieve it using h = get(gca,'Children')

Share:
11,024

Related videos on Youtube

Admin
Author by

Admin

Updated on April 20, 2022

Comments

  • Admin
    Admin about 2 years

    I'm a matlab newbie, and i'd like to superpose some hist fit on a same figure. I know the function histfit, but unfortunatly i can't get to remove the hist and only keep the curve. I guess once i'll know how to do that i'll be able to add several curves using "hold on".

    Thanx for any answers or advices!

  • Franck Dernoncourt
    Franck Dernoncourt almost 11 years
    With R2012a, I use delete(h(2)) to delete the histogram.