plott(3f) - [M_datapac:GENERIC_LINE_PLOT] generate a line printer plot of Y vs X for the terminal (71 characters wide)
Synopsis
Description
Input Arguments
Output
Examples
Author
Maintainer
License
SUBROUTINE PLOTT(Y,X,N)
REAL(kind=wp),intent(in) :: X(:) REAL(kind=wp),intent(in) :: Y(:) INTEGER,intent(in) :: N
PLOTT(3f) yields a narrow-width (71-character) plot of Y(i) versus X(i). Its narrow width makes it appropriate for use on a terminal.
Note values in the vertical axis vector (y) or the horizontal axis vector (x) which are equal to or in excess of 10.0**10 will not be plotted.
This convention greatly simplifies the problem of plotting when some elements in the vector y (or x) are missing data, or when we purposely want to ignore certain elements in the vector y (or x) for plotting purposes (that is, we do not want certain elements in y (or x) to be plotted). To cause specific elements in y (or x) to be ignored, we replace the elements beforehand (by, for example, use of the REPLAC(3f) subroutine) by some large value (like, say, 10.0**10) and they will subsequently be ignored in the plot subroutine.
Note that the storage requirements for this (and the other) terminal plot subroutines are very small. This is due to the "one line at a time" algorithm employed for the plot.
Y The vector of (unsorted or sorted) observations to be plotted vertically. X The REAL vector of (unsorted or sorted) observations to be plotted horizontally. N The integer number of observations in the vector Y. There is no restriction on the maximum value of N for this subroutine.
A narrow-width (71-character) terminal plot of y(i) versus x(i). The body of the plot (not counting axis values and margins) is 25 rows (lines) and 49 columns.
Sample program:
program demo_plott use M_datapac, only : plott, label implicit none integer :: i integer,parameter :: dp=kind(0.0d0) real(kind=dp), allocatable :: x(:), y(:) call label(plott) y=[(real(i)/10.0,i=1,30)] x=y**3.78-6*y**2.52+9*y**1.26 call plott(x,y,size(x)) end program demo_plottResults:
The following is a plot of Y(I) (vertically) versus X(I) (horizontally) I-----------I-----------I-----------I-----------I 0.4000000E+01 - X X X X 0.3833356E+01 I X X 0.3666712E+01 I X 0.3500068E+01 I X 0.3333424E+01 I X 0.3166780E+01 I X 0.3000137E+01 - X 0.2833493E+01 I X 0.2666849E+01 I X 0.2500205E+01 I X 0.2333561E+01 I X 0.2166917E+01 I X 0.2000273E+01 - 0.1833629E+01 I 0.1666985E+01 I X X X 0.1500341E+01 I 0.1333698E+01 I X 0.1167054E+01 I 0.1000410E+01 - X 0.8337659E+00 I X X 0.6671220E+00 I 0.5004781E+00 I X X 0.3338342E+00 I X 0.1671903E+00 I X X 0.5463774E-03 - X X I-----------I-----------I-----------I-----------I 0.1000E+00 0.8250E+00 0.1550E+01 0.2275E+01 0.3000E+01
The original DATAPAC library was written by James Filliben of the Statistical Engineering Division, National Institute of Standards and Technology.
John Urban, 2022.05.31
CC0-1.0
Nemo Release 3.1 | plott (3) | February 23, 2025 |