Octave中plot函数的用法

octave:14> help plot
‘plot‘ is a function from the file C:\Octave\Octave3.6.4_gcc4.6.2\share\octave\3.6.4\m\plot\plot.m

-- Function File: plot (Y)
-- Function File: plot (X, Y)
-- Function File: plot (X, Y, PROPERTY, VALUE, ...)
-- Function File: plot (X, Y, FMT)
-- Function File: plot (H, ...)
-- Function File: H = plot (...)
Produce two-dimensional plots.

产生一个二维图像。

Many different combinations of arguments are possible. The
simplest form is

plot (Y)

where the argument is taken as the set of Y coordinates and the X
coordinates are taken to be the indices of the elements starting
with 1.

To save a plot, in one of several image formats such as PostScript
or PNG, use the `print‘ command.

If more than one argument is given, they are interpreted as

plot (Y, PROPERTY, VALUE, ...)

or

plot (X, Y, PROPERTY, VALUE, ...)

or

plot (X, Y, FMT, ...)

and so on. Any number of argument sets may appear. The X and Y
values are interpreted as follows:

* If a single data argument is supplied, it is taken as the set
of Y coordinates and the X coordinates are taken to be the
indices of the elements, starting with 1.

* If the X is a vector and Y is a matrix, then the columns (or
rows) of Y are plotted versus X. (using whichever
combination matches, with columns tried first.)

* If the X is a matrix and Y is a vector, Y is plotted versus
the columns (or rows) of X. (using whichever combination
matches, with columns tried first.)

* If both arguments are vectors, the elements of Y are plotted
versus the elements of X.

* If both arguments are matrices, the columns of Y are plotted
versus the columns of X. In this case, both matrices must
have the same number of rows and columns and no attempt is
made to transpose the arguments to make the number of rows
match.

If both arguments are scalars, a single point is plotted.

Multiple property-value pairs may be specified, but they must
appear in pairs. These arguments are applied to the lines drawn by
`plot‘.

If the FMT argument is supplied, it is interpreted as follows. If
FMT is missing, the default gnuplot line style is assumed.

`-‘
Set lines plot style (default).

`.‘
Set dots plot style.

`N‘
Interpreted as the plot color if N is an integer in the range
1 to 6.

`NM‘
If NM is a two digit integer and M is an integer in the range
1 to 6, M is interpreted as the point style. This is only
valid in combination with the `@‘ or `[email protected]‘ specifiers.

`C‘
If C is one of `"k"‘ (black), `"r"‘ (red), `"g"‘ (green),
`"b"‘ (blue), `"m"‘ (magenta), `"c"‘ (cyan), or `"w"‘
(white), it is interpreted as the line plot color.

`";title;"‘
Here `"title"‘ is the label for the key.

`+‘
`*‘
`o‘
`x‘
`^‘
Used in combination with the points or linespoints styles,
set the point style.

`@‘
Select the next unused point style.

The FMT argument may also be used to assign key titles. To do so,
include the desired title between semi-colons after the formatting
sequence described above, e.g., "+3;Key Title;" Note that the last
semi-colon is required and will generate an error if it is left
out.

Here are some plot examples:

plot (x, y, "@12", x, y2, x, y3, "4", x, y4, "+")

This command will plot `y‘ with points of type 2 (displayed as
`+‘) and color 1 (red), `y2‘ with lines, `y3‘ with lines of color
4 (magenta) and `y4‘ with points displayed as `+‘.

plot (b, "*", "markersize", 3)

This command will plot the data in the variable `b‘, with points
displayed as `*‘ with a marker size of 3.

t = 0:0.1:6.3;
plot (t, cos(t), "-;cos(t);", t, sin(t), "+3;sin(t);");

This will plot the cosine and sine functions and label them
accordingly in the key.

If the first argument is an axis handle, then plot into these axes,
rather than the current axis handle returned by `gca‘.

The optional return value H is a graphics handle to the created
plot.

See also: semilogx, semilogy, loglog, polar, mesh, contour, bar,
stairs, errorbar, xlabel, ylabel, title, print

Additional help for built-in functions and operators is
available in the online version of the manual. Use the command
‘doc <topic>‘ to search the manual index.

Help and information about Octave is also available on the WWW
at http://www.octave.org and via the [email protected]
mailing list.

时间: 2024-11-09 05:48:04

Octave中plot函数的用法的相关文章

awk中split函数的用法

The awk function split(s,a,sep) splits a string s into an awk array a using the delimiter sep. time=12:34:56 echo $time | awk '{split($0,a,":" ); print a[1]}' 12   echo $time | awk '{split($0,a,":" ); print a[3]}' 34   echo $time | awk

Matlab中plot函数全功能解析

Matlab中plot函数全功能解析 功能 二维曲线绘图 语法 plot(Y)plot(X1,Y1,...)plot(X1,Y1,LineSpec,...)plot(...,'PropertyName',PropertyValue,...)plot(axes_handle,...)h = plot(...)hlines = plot('v6',...) 描述 plot(Y)如果Y是m×n的数组,以1:m为X横坐标,Y中的每一列元素为Y坐标,绘制n条曲线:如果Y是n×1或者1×n的向量,则以1:n

PHP中spl_autoload_register函数的用法

spl_autoload_register (PHP 5 >= 5.1.2) spl_autoload_register — 注册__autoload()函数 说明bool spl_autoload_register ([ callback $autoload_function ] )将函数注册到SPL __autoload函数栈中.如果该栈中的函数尚未激活,则激活它们. 如果在你的程序中已经实现了__autoload函数,它必须显式注册到__autoload栈中.因为 spl_autoload

Delphi中 StrToIntDef函数的用法

Delphi中 StrToIntDef函数的用法: 比如我要判断一个文本框里输入的字符串能不能转换为integer类型,如果能,则返回转换后的整型数据,如果不能,则返回整数0,那么我就可以用strtointdef这个函数. 写法如下: 假设edit1.text:='1000'; 则strtointdef(edit1.text,0)返回值为1000. 如果edit1.text:='fdafds',则返回值为0. (如果你用strtoint(edit1.text)当edit1.text:='fdad

C++中substr函数的用法

原文地址:http://blog.csdn.net/no_retreats/article/details/7853066 C++中substr函数的用法 #include<string>#include<iostream>using namespace std; main(){string s("12345asdf");string a=s.substr(0,5);       //获得字符串s中 从第0位开始的长度为5的字符串//默认时的长度为从开始位置到尾

解析PHP中ob_start()函数的用法

解析PHP中ob_start()函数的用法 本篇文章是对PHP中ob_start()函数的用法进行了详细的分析介绍,需要的朋友参考下 ob_start()函数用于打开缓冲区,比如header()函数之前如果就有输出,包括回车/空格/换行/都会有"Header had all ready send by"的错误,这时可以先用ob_start()打开缓冲区PHP代码的数据块和echo()输出都会进入缓冲区而不会立刻输出.当然打开缓冲区的作用很 多,只要发挥你的想象.可以总结以下四点: 1.

【原创】Matlab中plot函数全功能解析

[原创]Matlab中plot函数全功能解析 该帖由Matlab技术论(http://www.matlabsky.com)坛原创,更多精彩内容参见http://www.matlabsky.com 功能 二维曲线绘图 语法 plot(Y)plot(X1,Y1,...)plot(X1,Y1,LineSpec,...)plot(...,'PropertyName',PropertyValue,...)plot(axes_handle,...)h = plot(...)hlines = plot('v6

(转)解析PHP中ob_start()函数的用法

本篇文章是对PHP中ob_start()函数的用法进行了详细的分析介绍,需要的朋友参考下 ob_start()函数用于打开缓冲区,比如header()函数之前如果就有输出,包括回车/空格/换行/都会有"Header had all ready send by"的错误,这时可以先用ob_start()打开缓冲区PHP代码的数据块和echo()输出都会进入缓冲区而不会立刻输出.当然打开缓冲区的作用很多,只要发挥你的想象.可以总结以下四点: 1.用于header()之前ob_start();

CC++中sizeof函数的用法

C/C++中sizeof()函数的用法 学习C/C++有时会遇到下面的情况: 已知 char *str1="absde"; char str2[]="absde"; char str3[8]={'a'}; char str4 [] = "0123456789"; 为什么sizeof(str1)=4 sizeof(str2)=6; sizeof(str3)=8; sizeof(str4)=11;呢? 丈二和尚摸不着头脑,接下来我们一起好好讨论讨论,