Prints a scatter plot of several groups of data.
A NOBS by NVAR matrix containing the data. (Input)
ICOL Vector of
length NVAR
representing the nature of each column of matrix A. (Input)
The I-th
column of A is
the independent variable vector if ICOL(I) = 1. The I-th column of A is a dependent
variable vector if ICOL(I) = 2. The I-th column of A is ignored
otherwise.
RANGE Vector of
length four specifying minimum x, maximum x, minimum y and
maximum y. (Input)
SCTP will calculate
the range of the axis if the minimum of that range is greater than or equal to
the maximum of that range.
SYMBOL CHARACTER string of
length NVAR.
(Input)
SYMBOL (I : I) is the character
used to plot the data set represented by column I. SYMBOL(I : I) is ignored if ICOL(I) ≠ 2.
XTITLE CHARACTER string containing the x-axis title. (Input)
YTITLE CHARACTER string containing the y-axis title. (Input)
TITLE CHARACTER string containing the plot title. (Input)
NOBS Number of
observations. (Input)
Default: NOBS = size (A,1).
NVAR Number of
variables. (Input)
Default: NVAR = size (A,2).
LDA Leading
dimension of A
exactly as specified in the dimension statement of the calling
program. (Input)
Default: LDA = size (A,1).
Generic: CALL SCTP (A, ICOL, RANGE, SYMBOL, XTITLE, YTITLE, TITLE [, ])
Specific: The specific interface names are S_SCTP and D_SCTP.
Single: CALL SCTP (NOBS, NVAR, A, LDA, ICOL, RANGE, SYMBOL, XTITLE, YTITLE, TITLE)
Double: The double precision name is DSCTP.
Routine SCTP prints a scatter plot of one variable on the x-axis against several variables on the y-axis. For multiple points, 2, 3, , 9 are used to denote the number of points at a location. The character M is used when the number of points is greater than 9. Any entry of the matrix A containing NaN (not a number) is ignored. See AMACH in Machine-Dependent Constants.
1. Informational errors
Type Code
3 10 XTITLE is too long to fit into the page width determined by the routine PGOPT. XTITLE is truncated from the right side.
3 11 YTITLE is too long to fit into the page width determined by the routine PGOPT. YTITLE is truncated from the right side.
3 12 TITLE is too long to fit into the page width determined by the routine PGOPT. TITLE is truncated from the right side.
2. Integers 2, , 9 indicate two through nine points occupying the same plot position, respectively, and the character M indicates 10 or more multiple points. Consequently, it is recommended not to use any one of the above characters for SYMBOL.
3. One and only one column of A can be the independent variable vector.
4. A point is ignored if either the independent or the dependent variable contains NaN (not a number).
5. Output is written to the unit number specified by the routine UMACH (see the Reference Material section in this manual;).
6. Default page width and length are 78 and 60; respectively. The user may change them by calling the routine PGOPT (see Chapter 19, Utilities;) in advance.
This example prints a scatter plot of width against length for 150 iris petals. The routine GDATA (see Chapter 19, Utilities) is used to retrieve the Fisher iris data.
USE GDATA_INT
USE SCTP_INT
USE PGOPT_INT
IMPLICIT NONE
INTEGER ICOL(5), IDATA, IPAGE, LDA, NDA, NOBS, NVAR
REAL A(150,5), RANGE(4)
CHARACTER SYMBOL*5
!
DATA ICOL/5*0/
DATA RANGE/4*0./
DATA SYMBOL/' *'/
!
IDATA = 3
! Get Fisher Iris Data
CALL GDATA (IDATA, A, NOBS, NVAR)
! Plot petal width against
! petal length
ICOL(4) = 1
ICOL(5) = 2
! Set page width and length
IPAGE = 78
CALL PGOPT (-1, IPAGE)
IPAGE = 40
CALL PGOPT (-2, IPAGE)
CALL SCTP (A, ICOL, RANGE, SYMBOL, 'Petal length', &
'Petal width', 'Fisher Iris Data')
!
END
Fisher Iris Data
:
: * **
2.4 -: * 2
: **** * * * *
: * * *
:
: **** * *
: **** * *
: *2 * *
: 32 * 2* * * *
:
: * *
P 1.6 -: * * * *
e : * 5** 2**
t : * 2 *2* *
a :
l : * 3222***
: ** * * *
w : * **
i : 2 2 * **
d :
t :
h 0.8 -:
:
: *
:
: *
: * 3** *
: 23* *
:* 24875* *
:
: * 22
0.0 -:
:...............................................................
: : : : : : :
1.
2.
3.
4.
5.
6. 7.
Petal length
PHONE: 713.784.3131 FAX:713.781.9260 |