Chapter 5: Plotting Curves
This chapter describes how to plot curves with lines and symbols.
Several curves can be plotted in one axis system and can be
differentiated by colour, line style and pattern.
Curve attributes can be plotted in a legend.
C U R V E
CURVE connects data points with lines or plots them with symbols.
- The call is:
- CALL CURVE (XRAY, YRAY, N) - level 2, 3
- XRAY, YRAY
- are arrays that contain X- and Y-coordinates.
- N
- is the number of data points.
Additional notes:
- CURVE must be called after GRAF from level 2 or 3.
- By default, data points that lie outside of an axis system
are listed on the screen. The listing can be suppressed with
the routine NOCHEK.
- For a logarithmic scaling of an axis, CURVE suppresses the
plotting of curves and prints a warning if some corresponding
data coordinates have non positive values. After the statement
CALL NEGLOG (EPS), where EPS is a small positiv floating-point
number, CURVE will use the value EPS for non positive values.
- CURVE suppresses lines outside the borders of an axis system.
Suppressing can be disabled with NOCLIP or the
margins of suppression can be changed with GRACE.
- INCMRK determines if CURVE plots lines or symbols.
- When plotting several curves, attributes such as colour
and line style can be changed automatically by DISLIN or
directly by the user. The routine CHNCRV defines which
attributes are changed automatically.
The routines COLOR or SETCLR are used to define colours,
SOLID, DOT, DASH, CHNDOT, CHNDSH, DOTL, DASHM and DASHL to
define line styles and MARKER to define symbols plotted
with the routine CURVE.
- Different data interpolation methods can be chosen with POLCRV.
To differentiate multiple curves in an axis system, legends with text can be
plotted. DISLIN can store up to 30 curve attributes such as symbols,
thicknesses, line styles and colours and these can be incorporated in a
legend.
Legends are created with the following steps:
- define a character variable used to store the lines of text
in the legend
- initialize the legend
- define the lines of text
- plot the legend.
The corresponding routines are:
L E G I N I
LEGINI initializes a legend.
- The call is:
- CALL LEGINI (CBUF, NLIN, NMAXLN) - level 1, 2, 3
- CBUF
- is a character variable used to store the lines of text
in the legend. The variable must be defined by the user to have
at least NLIN * NMAXLN characters.
- NLIN
- is the number of text lines in the legend.
- NMAXLN
- is the number of characters in the longest line
of text.
L E G L I N
LEGLIN stores lines of text for the legend.
- The call is:
- CALL LEGLIN (CBUF, CSTR, ILIN) - level 1, 2, 3
- CBUF
- see LEGINI.
- CSTR
- is a character string that contains a line of text
for the legend.
- ILIN
- is the number of the legend line between 1 and
NLIN.
L E G E N D
LEGEND plots legends.
- The call is:
- CALL LEGEND (CBUF, NCOR) - level 2, 3
- CBUF
- see LEGINI.
- NCOR
- indicates the position of the legend:
- = 1
- is the lower left corner of the page.
- = 2
- is the lower right corner of the page.
- = 3
- is the upper right corner of the page.
- = 4
- is the upper left corner of the page.
- = 5
- is the lower left corner of the axis system.
- = 6
- is the lower right corner of the axis system.
- = 7
- is the upper right corner of the axis system.
- = 8
- is the upper left corner of the axis system.
The
following
routines
change
the
position
and appearance of a legend. They must be called
after LEGINI except for the routines FRAME and LINESP.
- LEGTIT (CTIT) sets the title of the legend.
Default: CTIT = 'Legende'.
- LEGPOS (NX, NY) defines a global position for the legend
where NX and NY are the plot coordinates of the upper left
corner. After a call to LEGPOS, the second
parameter in LEGEND will be ignored.
- NLX = NXLEGN (CBUF) and NYL = NYLEGN (CBUF) return the
length and the height of a legend in plot coordinates.
- FRAME (NFRA) defines the thickness of a frame plotted
around a legend.
- LINESP (XF) changes the spacing of lines in a legend.
- LEGCLR retains the same colour for curves and lines of
text in the legend.
- The statement CALL MIXLEG enables multiple text lines in
legends. By default, the character '/' is used as a newline
character but can be changed with the routine SETMIX.
L E G P A T
The routine LEGPAT stores curve attributes plotted in legends. Normally,
this is done automatically by routines such as CURVE and BARS.
- The call is:
- CALL LEGPAT (ITYP, ITHK, ISYM, ICLR, IPAT, ILIN)
- level 1, 2, 3
- ITYP
- is the line style between -1 and 7 (see LINTYP).
IF ITYP = -1, no line will be plotted in the legend
line.
- ITHK
- defines the thickness of lines (> 0).
- ISYM
- is the symbol number between -1 and 21. If ISYM = -1, no
symbol will be plotted in the legend line.
- ICLR
- is the colour value between -1 and 255. If ICLR = -1,
the current colour will be used.
- IPAT
- is the shading pattern (see SHDPAT). If IPAT = -1, no
pattern will be plotted in the legend line.
- ILIN
- is the legend line between 1 and NLIN.
Additional notes:
- The routine LEGPAT is useful to create
legends without calls to CURVE.
- LEGPAT must be called after LEGINI.
L E G O P T
The routine LEGOPT modifies the appearance of legends.
- The call is:
- CALL LEGOPT (XF1, XF2, XF3) - level 1, 2, 3
- XF1
- is a multiplier for the length of the pattern field. The
length is XF1 * NH, where NH is the current character
height. If XF1 = 0., the pattern field will be suppressed.
- XF2
- is a multiplier for the distance between legend frames
and text. The distance is XF2 * NH * XSPC, where XSPC is
the spacing between legend lines (see LINESP).
- XF3
- is a multiplier for the spacing between multiple text
lines. The space is XF3 * NH * XLINSP.
Default: (4.0, 0.5, 1.0).
S H D C R V
SHDCRV plots a shaded area between two curves.
- The call is:
- CALL SHDCRV (X1RAY, Y1RAY, N1, X2RAY, Y2RAY, N2)
- level 2, 3
- X1RAY, Y1RAY
- are arrays with the X- and Y-coordinates of the
first curve. Values are not changed by SHDCRV.
- N1
- is the number of points in the first curve.
- X2RAY, Y2RAY
- are arrays with the X- and Y-coordinates of the
second curve. Values are not changed by SHDCRV.
- N2
- is the number of points in the second curve.
Additional notes:
- The maximum number of data points cannot be greater than 2000.
- Different shading patterns can be selected with
SHDPAT. The pattern number will automatically
be incremented by 1 after a call to SHDCRV.
- Legends may be plotted for shaded curves.
- The routine NOARLN will suppress border lines
around shaded areas.
E R R B A R
The routine ERRBAR plots error bars.
- The call is:
- CALL ERRBAR (XRAY, YRAY, E1RAY, E2RAY, N)
- level 2, 3
- XRAY, YRAY
- are arrays that contain the X- and Y-coordinates.
- E1RAY, E2RAY
- are arrays that contain the errors.
Lines will be drawn from YRAY - E1RAY to YRAY + E2RAY.
- N
- is the number of data points.
Additional notes:
- Horizontal bars will be drawn after CALL BARTYP ('HORI').
- A symbol can be selected with MARKER and the symbol size
with HSYMBL.
F I E L D
The routine FIELD plots a vector field.
- The call is:
- CALL FIELD (X1RAY, Y1RAY, X2RAY, Y2RAY, N, IVEC)
- level 2, 3
- X1RAY, Y1RAY
- are arrays that contain the X- and Y-coordinates
of the start points.
- X2RAY, Y2RAY
- are arrays that contain the X- and Y-coordinates
of the end points.
- N
- is the number of vectors.
- IVEC
- is a four digit number that specifies the vector (see VECTOR).
Next |
Previous |
Contents