# subplot (MathScript RT Module Function)

LabVIEW 2012 MathScript RT模块帮助

»查看产品信息

Owning Class: plots

Requires: MathScript RT Module

## Syntax

subplot(a, b, c)

subplot(ijk)

subplot('position', pos)

obj = subplot(a, b, c)

obj = subplot(ijk)

obj = subplot('position', pos)

## Description

Generates a plot window with multiple plots. subplot(a, b, c) or subplot(ijk) generate a plot window with a or i rows and b or j columns of plots. subplot('position', pos) adds a plot area into a plot window at a specified position.

Examples

## Inputs

Name Description
a Specifies the number of rows of plots to generate. a is a positive integer.
b Specifies the number of columns of plots to generate. b is a positive integer.
c Specifies the active plot according to the row-wise linear order of the plots. c is a positive integer between 1 and a*b.
ijk Specifies the number of rows, i, and the number of columns, j, to generate, as well as the active plot, k. i, j, and k are positive integers between 1 and 9.
pos Specifies the position of the plot area, which does not include the title or the labels of the axes. pos must be an array of four values. The first and second values specify the horizontal and vertical distance from the lower left corner of the plot window to the lower left corner of the plot area. The third and fourth values specify the width and height of the plot area. The values in pos are normalized such that the bottom left corner and the upper right corner of the plot area are (0, 0) and (1, 1), respectively.

## Outputs

Name Description
obj Returns the reference to the current plot area. obj is a reference to a plot area.

## Details

The following table lists the support characteristics of this function.

 Supported in the LabVIEW Run-Time Engine No (returns error or is ignored) Supported on RT targets No

## Examples

X = 0:10;
Y = X.*X;
subplot(2, 1, 1)
plot(X)
subplot(212)
plot(Y)

obj = subplot(212);
set(obj, 'Color', 'c', 'XColor', 'm', 'YColor', 'm')
a = subplot(211);
set(a, 'Color', 'm', 'XColor', 'c', 'YColor', 'c')

X = 0:0.1:10*pi;
Y1 = sin(X);
Y2 = cos(X);

subplot('position', [0.1, 0.6, 0.8, 0.3])
plot(X, Y1)
subplot('position', [0.1, 0.1, 0.8, 0.3])
plot(X, Y2)

﻿