plotPlotting
plot(y)y should be a scalar, vector or matrix.y is a scalar, only the point [1, y] is plotted.y is a vector (row or column) of k entries, a line of k data points is plotted.y is a matrix of size [np, nl] with np > 1 and nl > 1, then nl separate lines of np data points are plotted. y is real, it gives the same result as plot(1:np, y), where np is the number of rows of y.y is complex, it gives the same result as plot(real(y), imag(y)).plot(y,spec)plot(y) above, but it has additional controls over line attributes using the specification string spec.spec should be a character vector specifying values of various line attributes.spec. The available ones are 'color', 'lineStyle' and 'marker'.'-r' means a solid line of red color. An attribute value in a specification string can be over-written by a latter value in the same string. For example, '-.-' gives a solid line since '-.' (dash-dotted line) is overwritten by '-' (solid line). Similarly, 'blackred' gives a red line, instead of a black one.spec applies to all lines generated for y. Hence, all lines have the same line style and marker style specified by spec.plot(1:np, y, spec) where np is the number of rows of y.plot(y,name1,value1,...,nameN,valueN)plot(y,spec,name1,value1,...,nameN,valueN)name1, ..., nameN are attribute names, and value1, ..., valueN are their associated values.spec, can be overwritten by value1, ..., valueN.plot(x,y)plot(x,y,spec)plot(x,y,name1,value1,...,nameN,valueN)plot(x,y,spec,name1,value1,...,nameN,valueN)x and y should be scalars, vectors, or matrices of numeric values.
If y has size [m, n], where m >= 1 and n >= 1, then x should be either a matrix of the same size, or a vector of length m or n:
x is a matrix, then n lines of m data points will be plotted.x is a vector of length m, then n lines of m data points will be plotted. x is a vector of length n, then m lines of n data points will be plotted.x or y is complex, only the real parts will be used.plot(y, 'spec') above for the description of the line specification string spec.name1, ..., nameN are attribute names, and value1, ..., valueN are their associated values.plot(x1,y1,spec1,...,xM,yM,specM,name1,value1,...,nameN,valueN)x1, ..., xM and y1, ..., yM are as described above in plot(x, y).spec1, ..., specM are as described above in plot(y, spec). Any of spec1, ..., specM can be omitted.name1, ..., nameN are attribute names, and value1, ..., valueN are their associated values.spec, is a concatenation of attribute values.'color'), line style ('lineStyle') and marker style ('marker'). When the color attribute is set, it changes the line color and marker edge color simultaneously.'r-..' means a red (r) dash-dotted line (-.) with point markers (.).'r-..' and '.-.r' give the same result.'--' means a blue dashed line without marker.The following show the attribute names and their associated values.
LineStyle| Value | Description |
|---|---|
'-' | Solid line |
'--' | Dashed line |
'-.' | Dash-dotted line |
':' | Dotted line |
'none' | No line |
The default line style is 'none' if the marker is specified. If no marker is specified, the default line style is '-'.
'Color'| Value | Description |
|---|---|
'b', 'blue' | Blue |
'r', 'red' | Red |
'm', 'magenta' | Magenta |
'g', 'green' | Green |
'c', 'cyan' | Cyan |
'y', 'yellow' | Yellow |
'k', 'black' | Black |
'w', 'white' | White |
[r, g, b] | RGB vector, where |
If the line color is not specified, it is assigned to blue, red, orange, purple, magenta, green, cyan or yellow in a cyclic manner. More precisely, the [r,g,b] cannot be used in a specification string.
'Marker'| Value | Description |
|---|---|
'o' | Circle |
'+' | Plus |
'*' | Asterisk |
'.' | Point |
's', 'square' | Square |
'd', 'diamond' | Diamond |
'x' | Cross |
'^' | Up triangle |
'v' | Down triangle |
'<' | Left triangle |
'>' | Right triangle |
'p', 'pentagram' | Pentagram |
'h', 'hexagram' | Hexagram |
'none' | No marker |
MarkerEdgeColorThe values are the same as those for Color above.
MarkerEdgeColorThe values are the same as those for Color above.
MarkerSizeIt should be a positive number. The default size is 6.0
DisplayNameIt is the name shown in the legend. It should be given as a character vector. The default value is "Line".