MATLAB: How to put errorbars


Hi Everyone, How can i put errorbars in my figure below (Between red and green graphs)?

Best Answer

  • Use the errorbar function on the line of your choice. The easiest way to do this is to plot that line, then use hold to plot the others:
    errorbar(Traffic, EngsetPb, barvector)
    hold on
    plot( ... the rest ... )
    hold off
    Hypothetical variables here.