How can I multiple plot in one figure at Matlab?

前端 未结 3 1440
猫巷女王i
猫巷女王i 2021-01-25 04:56

Hi I\'m trying to implement as following code.

plot(bins,r);
plot(bins,g);
plot(bins,b);

But I want to plot in one figure. Is there any way?

3条回答
  •  清歌不尽
    2021-01-25 05:26

    You need to use hold on

    hold on retains plots in the current axes so that new plots added to the axes do not delete existing plots. New plots use the next colors and line styles based on the ColorOrder and LineStyleOrder properties of the axes. MATLAB® adjusts axes limits, tick marks, and tick labels to display the full range of data.

    hold on
    plot(bins,r)
    plot(bins,g)
    plot(bins,b)
    

提交回复
热议问题