【问题标题】:matlab dynamic scrolling in figuresmatlab动态滚动图形
【发布时间】:2018-04-22 14:05:22
【问题描述】:

我在 Matlab 中的图形对象中添加了多个时间序列,并将它们绘制为图表上的子图,以将它们一个接一个地显示在一起。可以有动态数量的时间序列图,我无法提前知道会有多少。

不幸的是,似乎正在发生的事情是,随着新的子图的添加,数字图没有扩展到包含滚动条。是否有一个我没有看到的特定标志包含它并阻止我的图形对象中的图变得越来越小?

举个例子:

%Maximise the figure window to full screen
    f = figure;
    f=gcf;
    f.Units='normalized';
    f.OuterPosition=[0 0 1 1];

    %Add a panel to the figure, we'll add subplots to this
    p = uipanel('Parent',f,'BorderType','none'); 
    p.Title = 'Examples'; 
    p.TitlePosition = 'centertop'; 
    p.FontSize = 12;
    p.FontWeight = 'bold';

    %Add a timeseries subplot to the panel
    subplot((length(motifIndexAfterThresholds)*2)+1,1,1, 'Parent',p)
    ts0 = timeseries(E4_hrX(startIndex:endIndex),'Name','Parent Motif');
    plot(ts0)
    title('Parent')

在这一点之后,我可以添加任意数量的子图,但面板并没有像我希望的那样伸展。

如果有人能提供建议,我将非常感激。

【问题讨论】:

    标签: matlab


    【解决方案1】:

    任何有同样问题的人,请查看这篇(2011 年)博客文章: https://blogs.mathworks.com/pick/2011/11/23/scrolling-figures-guis/

    事实证明,用户提交的函数可以提供此功能,我们需要做的就是下载该 .m 文件,将其包含在您的 Matlab 路径中,在我们的代码中将函数调用从 subplot 更改为 scrollsubplot。

    不知道这是否会长期有效,这样的功能可能应该由 matlab 本身开箱即用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多