是否有 MATLAB 误差条图的替代品可以刷数据?

发布于 2024-12-08 15:16:35 字数 609 浏览 0 评论 0原文

如文档中所述,MATLAB 的 brush 不适用于 errorbar 绘图(请参阅无法刷的绘图类型部分)。例如,

figure;
errorbar((1:10)+2*sin(.3:.3:3),cos(1:1:10)/2);
hold all;
plot(10:-1:1,'o-g');
brush

生成一个绘图,我可以从绿色绘图中刷取数据点,但不能从红色错误栏绘图中刷取数据点:

screenshot

更新

理想情况 我想找到一种方法来追溯地使带有误差线的图可刷,无需提取 XData和 YData 并重新创建带有plot的图表。

如果做不到这一点,是否有一个函数可以替换 errorbar ,从而允许我将来创建的绘图使用此功能?

As noted in the documentation, MATLAB's brush does not work with errorbar plots (see section Plot Types You Cannot Brush). For example,

figure;
errorbar((1:10)+2*sin(.3:.3:3),cos(1:1:10)/2);
hold all;
plot(10:-1:1,'o-g');
brush

generates a plot where I can brush data points from the green plot, but not from the red errorbar plot:

screenshot

Update

Ideally I would like to find a way to retroactively make plots with error bars brushable, short of extracting XData and YData and recreating a graph with plot.

Failing that, is there a function to replace errorbar which allows this for plots I create in the future?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

粉红×色少女 2024-12-15 15:16:35

通过 line 创建的绘图对象不可刷,但通过 plot 创建的绘图对象可以。由于这两个对象都是 line 类型,我怀疑差异可能在于 Java 级别。

不过,这提出了一种解决方法:您可以编写一个版本的 errorbar,它使用 line 命令而不是plot 命令来绘制误差条,这样你就可以只浏览情节。

Plot objects created via line are not brushable, but those created via plot are. Since both objects are of type line, I suspect the difference might be on the level of Java.

However, this suggests a workaround: You can write a version of errorbar that uses the line command instead of the plot command to draw the errorbars, thus allowing you to browse just the plot.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文