主要内容

plot

Draw 2-D line plot of DataMatrix

Description

plot(DMObj1) plots the columns of a DataMatrix object DMObj1 versus their index.

plot(DMObj1,DMObj2) plots the data from DMObj1 and DMObj2, two DataMatrix objects, or one DataMatrix object and one numeric array.

example

plot(___,LineSpec) plots all lines as defined by LineSpec, specifying a line style, marker symbol, and color, for any of the previous input arguments.

Examples

collapse all

Load the MAT-file, provided with the software, that contains yeast data. This MAT-file includes three variables: yeastvalues, a 614-by-7 matrix of gene expression data, genes, a cell array of 614 GenBank® accession numbers for labeling the rows in yeastvalues, and times, a 1-by-7 vector of time values for labeling the columns in yeastvalues.

load filteredyeastdata

Create variables to contain a subset of the data, specifically the first five rows and first four columns of the yeastvalues matrix, the genes cell array, and the times vector.

yeastvalues2 = yeastvalues(1:5,1:4);
genes2 = genes(1:5,:);
times2 = times(1:4);

Create a DataMatrix object.

dmo = bioma.data.DataMatrix(yeastvalues2,genes2,times2)
dmo = 

                  0       9.5     11.5      13.5  
    SS DNA     -0.131    1.699    -0.026     0.365
    YAL003W     0.305    0.146    -0.129    -0.444
    YAL012W     0.157    0.175     0.467    -0.379
    YAL026C     0.246    0.796     0.384     0.981
    YAL034C    -0.235    0.487    -0.184    -0.669

Plot the yeast values as a function of time. In other words, create a time plot of each row (gene).

plot(times2,dmo)

Figure contains an axes object. The axes object contains 5 objects of type line.

Input Arguments

collapse all

DataMatrix, specified as a bioma.data.DataMatrix object or numeric array.

If both DMObj1 and DMObj2 are input arguments, one of the inputs can be a numeric array.

  • If DMObj1 and DMObj2 are both vectors, they must have the same number of elements, and plot plots one vector versus the other vector, creating a single line.

  • If one is a vector and one a scalar, plot plots discrete points vertically or horizontally, at the scalar value.

  • If one is a vector and one a matrix, the number of elements in the vector must equal either the number of rows or the number of columns in the matrix, and plot plots the vector versus each row or column in the matrix.

  • If both are matrices, they must have the same size (number of rows and columns), and plot plots each column in DMObj1 versus the corresponding column in DMObj2.

DataMatrix, specified as a bioma.data.DataMatrix object or numeric array.

If both DMObj1 and DMObj2 are input arguments, one of the inputs can be a numeric array.

  • If DMObj1 and DMObj2 are both vectors, they must have the same number of elements, and plot plots one vector versus the other vector, creating a single line.

  • If one is a vector and one a scalar, plot plots discrete points vertically or horizontally, at the scalar value.

  • If one is a vector and one a matrix, the number of elements in the vector must equal either the number of rows or the number of columns in the matrix, and plot plots the vector versus each row or column in the matrix.

  • If both are matrices, they must have the same size (number of rows and columns), and plot plots each column in DMObj1 versus the corresponding column in DMObj2.

Line specifications, specified as a character vector or string scalar. You can specify the line style, marker symbol, and color. For details, see Line Specifications.

Data Types: char | string

More About

collapse all

Version History

Introduced in R2008b

See Also

|