是否有 MATLAB 误差条图的替代品可以刷数据?
如文档中所述,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
生成一个绘图,我可以从绿色绘图中刷取数据点,但不能从红色错误栏绘图中刷取数据点:
更新
理想情况 我想找到一种方法来追溯地使带有误差线的图可刷,无需提取 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:
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过
line
创建的绘图对象不可刷,但通过plot
创建的绘图对象可以。由于这两个对象都是line
类型,我怀疑差异可能在于 Java 级别。不过,这提出了一种解决方法:您可以编写一个版本的 errorbar,它使用 line 命令而不是plot 命令来绘制误差条,这样你就可以只浏览情节。
Plot objects created via
line
are not brushable, but those created viaplot
are. Since both objects are of typeline
, 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 theline
command instead of theplot
command to draw the errorbars, thus allowing you to browse just the plot.