t=0:0.1:20;
f=[1 3  7
    2 5  9]
for i=1:6
    subplot(2,3,i)
    plot(t,chi2pdf(t,f(i))); 
    set(gca,'xtick', [1:2:9], 'ytick',0:.2:.4)
    if f(i)<4 
        set(gca,'ylim', [0 .5]); 
        set(gca,'xtick', [1:2:5], 'ytick',0:.2:.4)
    end
    title(sprintf('f=%d', f(i)));
    if i==1
        line( [0 f(i)+sqrt(2*f(i))], [.02 .02])
    else
        line( [f(i)-sqrt(2*f(i)) f(i)+sqrt(2*f(i))], [.02 .02])
    end    
    line( [f(i) f(i)], [.015 .025])
end
