Contents Previous Next Subchapters

Creating XY Plots
Syntax map = tpplot(Y)
map = tpplot(XY)
map = tpplot(XYpattern)
map = tpplot(XYpatternthickness)
See Also tpput , tpget , tpopen , tpsymbols , tpcolors , tpxyzaxes , tpframe , tpmapcopy

Description
Creates XY plots in Tecplot, of O-Matrix data. Plots a curve for each column of Y, where Y is an integer, real, or double-precision matrix specifying the Y value for each point. The first column corresponds to a curve with the next color in the current color sequence defined by tpcolors , the second column corresponds to the following color and so on. If X is not present, i is the X value corresponding to y(i,j).

If X is present, it must be is an integer, real, or double-precision matrix and have same number of rows as Y. If X is a column vector, each column of Y is plotted against the vector X. Otherwise X also must have the same number of columns as Y and each column, Y(i) is plotted against X(i).

If present, the argument pattern must be a character row vector equal to "SOLID", "DASHED", "DASHDOT", "DOTTED", "LONGDASH", or "DASHDOTDOT". The Tecplot line pattern for the current plot is set to this pattern.

If present, the argument thickness must a real-valued scalar with a value between 0.0 and 1.0. The Tecplot line thickness for the current plot is set to this value.

If the current frame does not contain a data set, or if the current data set does not contain at least 2 variables, a new frame is created with variables X, and Y. If the current frame does contain a data set with at least 2 variables, the plot is created by adding a new zone and transferring the X data to the first variable in the zone and the Y data to the second variable. The first map is copied to the end of the maps, activated, and assigned the zone that received the X and Y data from O-Matrix.

The returned value map is an integer scalar specifying the number of the map used for the current plot.

Examples
If at the O-Matrix prompt you enter,
   tpopen
   x = 0. : 0.1 : 2 * pi
   y = [sin(x), cos(x)]
   tpplot(y)
Tecplot will create the following plot



If you continue the example above by enter
   tpplot(y*3)
   tpplot(y*5)
Tecplot will create two new maps in the current frame which are copies of the first map, and will update the plot to include four additional curves.



The tpplot function can also specify the X values to be used for the given Y. If you enter the commands
   tpframe("My X Values")
   tpplot(x/2, y)
Tecplot will create a new frame title, "My X Values", that looks like


If you continue the example by entering,
   tpframe("Multiple X Values")
   tpplot( [x, x/2], y)
Tecplot will create a new frame named "Multiple X Values", where the first column of y is plotted vs. x and the second column of y is plotted vs. x/2
The Tecplot line pattern and thickness can be specified at the time that plots are created by O-Matrix. If you enter
   tpopen
   x = seq(100) / 10.0
   y = besselj(2, x)
   tpplot(x, y, "DASHDOT", 0.5)
Tecplot will create the following plot of the J2 Bessel function