绘制从csv文件读取的数据时出错

时间:2013-01-26 03:28:16

标签: plot octave

尝试使用GNU / octave绘图时出现以下错误:

octave:22> plot(b(:,2),b(:,4))
error: invalid conversion from real matrix to real scalar
error: __calc_dimensions__: expecting graphics handle as only argument
error: called from:
error:   /usr/share/octave/3.6.2/m/plot/private/__go_draw_axes__.m at line 55, column 8
error:   /usr/share/octave/3.6.2/m/plot/private/__go_draw_figure__.m at line 167, column 19
error:   /usr/share/octave/3.6.2/m/plot/__gnuplot_drawnow__.m at line 86, column 5
octave:23> 

变量 b csv 文件加载,如下所示:

b=csvread("my.csv")

my.csv 的内容

1,40.0942,0.775539,18.658
2,40.1882,0.857556,415.677
3,40.2818,0.858294,233.934
4,40.3748,0.887273,348.503
5,40.4669,0.908618,27.0149
6,40.558,0.908496,234.81
7,40.6478,0.911826,58.3943
8,40.7362,0.922848,204.128
9,40.823,0.928547,7.75615
10,40.908,0.920065,0.0654867
可悲的是,有时会发生错误,有些则不然。 (octave bug?)

有谁知道发生了什么事?

顺便说一句,我的系统是:Ubuntu 12.11,octave 3.6.2,Linux kernel 3.5.00-22-generic

修改

我认为这是一个错误。上述错误是由 plotyy 之后调用的 plot 引起的。要重现错误,请执行以下命令:

1> b=csvread("my.csv");
2> plot(b(:,2),b(:,4))
3> plotyy(b(:,1),b(:,2),b(:,1),b(:,4))
4> plot(b(:,2),b(:,4))

0 个答案:

没有答案