八度图()无法识别 fmt 字符串

octave plot() not recognizing fmt string

根据documentation for plot(),我应该可以通过格式参数来控制图形的样式。但是,Octave 似乎将其误解为不完整的 属性 规范,而不是格式字符串:

$ octave-cli
GNU Octave, version 4.4.1
Copyright (C) 2018 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-pc-linux-gnu".

Additional information about Octave is available at https://www.octave.org.

Please contribute if you find this software useful.
For more information, visit https://www.octave.org/get-involved.html

Read https://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.

1> t = linspace(0,5,1001);
2> plot(t, sin(pi*t), "g_;sin(πt)");
error: plot: properties must appear followed by a value
error: called from
    __plt__ at line 90 column 15
    plot at line 223 column 10

我是不是做错了什么或者这是一个错误?

正在按要求将我的评论转换为答案

来自文档:

The fmt format argument can also be used to control the plot style. It is a string composed of four optional parts: "<linestyle><marker><color><;displayname;>"

其中,有效的线型是:

‘-’     Use solid lines (default).
‘--’     Use dashed lines.
‘:’     Use dotted lines.
‘-.’     Use dash-dotted lines.

根据以上所述,格式字符串中有两个错别字。

首先是您使用 'underscore' (_) 而不是 'dash' (-) 作为线型说明符。

第二个是您没有按照语法要求 'enclose' 分号中的 "displayname";你只放了左边的分号却忘记了右边的分号

所以正确的格式字符串应该是:

plot( t, sin( pi * t ), "g- ;sin(πt);" );