【发布时间】:2022-01-01 23:18:29
【问题描述】:
我在 Octave 中绘制了一些二维图,我的代码如下所示
A=dlmread('data.txt');
x=A(:,1);
y=A(:,2);
err=A(:,3);
errorbar(x,y,err,'or','markerfacecolor','r','markersize',5)
问题是markerfacecolor 不起作用,markersize 也不起作用。我该如何解决这个问题? 命令窗口显示的错误如下
error: errorbar: data argument 5 must be numeric
error: called from
__errplot__ at line 44 column 7
errorbar at line 184 column 10
rbar at line 5 column 1
如果我删除markerfacecolor 和markersize,这段代码会很好地绘制。我的意思是它给出的输出没有 markerfacecolor , markersize 而不是在命令窗口中显示错误。请帮忙
文件 data.txt 是这种形式
1.0 3.1 0.21
2.0 4.1 0.29
3.1 5.2 0.42
4.0 6.1 0.53
4.9 7.7 0.63
6.0 8.0 0.72
6.0 9.0 0.75
7.0 13.1 0.21
8.0 23.1 0.21
9.0 29.3 0.21
10.0 30.1 8.21
11.1 28.7 2.1
12.0 23.1 2.2
13.1 18.1 1.61
【问题讨论】:
-
请edit您的问题包括minimal reproducible example,我们没有
data.txt -
我现在添加了有问题的 data.txt 文件
-
如果您阅读the documentation,您会注意到
errorbar不接受名称-值对。