【问题标题】:Matlab plotyy 4 plots with different LineStyleMatlab plotyy 4个不同LineStyle的图
【发布时间】:2014-11-07 14:39:29
【问题描述】:

我有这个 Matlab 代码

[ax,h1,h2] = plotyy(step,a1,step,b1);
hold(ax(1))
plot(ax(1),step,a2)
hold(ax(2))
plot(ax(2),step,b2)

结果图是这样的

其中 a2 和 b2 是平滑图,a1,b1 是另外两个。 我怎样才能只得到 a1 和 b1 虚线?

谢谢

【问题讨论】:

  • 使用 set(h1,'LineStyle','--') 等

标签: matlab plot


【解决方案1】:

由于已经将句柄保存到a1b1这行系列,可以使用

set(h1,'LineStyle','--');
set(h2,'LineStyle','--');

同样,您也可以更改颜色或添加标记。详情请参考Matlab documentation.

【讨论】:

    猜你喜欢
    • 2012-03-08
    • 1970-01-01
    • 2015-08-19
    • 1970-01-01
    • 2014-06-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多