【问题标题】:how do you plot 3 similar data sets on the same graph in different colors in MATLAB?如何在 MATLAB 中以不同颜色在同一张图上绘制 3 个相似的数据集?
【发布时间】:2013-05-15 00:41:19
【问题描述】:

如何使用 MATLAB 在同一图中绘制以下数据?

频率以赫兹 (Hz) 为单位,应为横轴。 下降时间以微秒 (us) 为单位,应为纵轴。

freq1 与 falltime1 一起使用 freq2 与 falltime2 一起使用 freq3 与 falltime3 一起使用

它们都应该有不同的颜色,并且图表应该有一个图例。

如何在 MATLAB 中实现这一点?

【问题讨论】:

    标签: matlab-figure


    【解决方案1】:

    hold on 命令可能是您想要的。

    figure
    hold on
    plot(freq1, falltime1, 'r-o') % plot in red, circles connected with lines
    plot(freq2, falltime2, 'g-o') % plot in green, circles connected with lines
    plot(freq3, falltime3, 'b-o') % plot in blue, circles connected with lines
    legend('1', '2', '3') % legend text
    xlabel('Hertz (Hz)')
    ylabel('Fall Time (\mus)')
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-07-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-07
      • 1970-01-01
      相关资源
      最近更新 更多