DISLIN - physics.muni.cz
Download
Report
Transcript DISLIN - physics.muni.cz
DISLIN
A Data Plotting Library
by
Helmut Michels
Contents
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Introduction
Basic Concepts
Introductory Routines
Plotting Axis Systems and Titles
Plotting Curves
Parameter Setting Routines
Elementary Plot Routines
Business Graphics
3-D Colour Graphics
3-D Graphics
Geographical Projections and Plotting Maps
Contouring
Widget Routines
Quickplots
Helmut Michels, MPI für Sonnensystemforschung
2
Introduction / What is DISLIN?
• DISLIN is a high-level plotting library for
displaying data as curves, bar graphs, pie
charts, 3D-colour plots, surfaces, contours
and maps.
• Programming Languages: Fortran 77,
Fortran 90, C, Perl, Python, Java
• Current Version:
9.0 (Nov. 2005)
• First Version:
1.0 (Dec. 1986)
Helmut Michels, MPI für Sonnensystemforschung
3
Introduction / Features
•
•
•
•
•
•
•
•
•
•
9 Vector fonts with 7 alphabets, bitmap fonts
Support of PostScript, X11 and Windows fonts
Axis systems with various formats
Plotting of curves and legends
3-D colour graphics
3-D graphics
Business graphics
Contours
Plotting maps
Widget routines
Helmut Michels, MPI für Sonnensystemforschung
4
Installation UNIX/Linux
•
•
•
•
•
gzip –d dislin-9.0.xxx.tar.gz
tar xvf dislin-9.0.xxx.tar
cd dislin-9.0
export DISLIN=dislin_directory (i.e. /usr/local/dislin)
./INSTALL
• General settings:
export DISLIN=dislin_directory
LD_LIBRARY_PATH=$DISLIN:$LD_LIBRARY_PATH
PATH=$PATH:$DISLIN/bin
Helmut Michels, MPI für Sonnensystemforschung
5
Installation Windows
• unzip dl_90_xx.zip (temporary directory)
• setup
- choose ok
- give the installation directory
• Global settings (Control Panel):
DISLIN=dislin_directory
PATH=%PATH%; dislin_directory\win
Helmut Michels, MPI für Sonnensystemforschung
6
Basic Concepts / Page Format
• Default Page:
•
•
•
DIN A4 Landscape
Origin:
Upper left corner
Plot unit: [cm / 100]
Routines:
SETPAG (COPT),
PAGE (NXP, NYP)
Helmut Michels, MPI für Sonnensystemforschung
7
Basic Concepts / File Formats
• Vector formats:
• Image formats:
• Screen output:
• Routines:
GKSLIN, CGM, PS,
EPS, PDF, HPGL,
WMF, SVG
TIFF, GIF, PNG, PPM,
BMP
CONS, XWIN
METAFL (Format)
SETFIL (Filename)
Helmut Michels, MPI für Sonnensystemforschung
8
Basic Concepts / Level Structure
•
•
•
•
Level 0 : before DISINI or after DISFIN
Level 1: after DISINI or after ENDGRF
Level 2: after GRAF, GRAFMP or POLAR
Level 3: after GRAF3 or GRAF3D
Helmut Michels, MPI für Sonnensystemforschung
9
Basic Concepts / Program Structure
• Setting of page format, file format and filename
•
•
•
•
•
•
(SETPAG, PAGE, METAFL, SETFIL)
Initialization (DISINI)
Setting of plot parameters
Plotting of the axis system (GRAF, POLAR,
GRAFMP, GRAF3, GRAF3D)
Plotting the title (TITLE)
Plotting data points (CURVE, CURVE3,
CURV3D, BARS, PIEGRF, SURFCE, CONTUR)
Termination (DISFIN)
Helmut Michels, MPI für Sonnensystemforschung
10
Basic Concepts / Conventions
• INTEGER variables begin with the
character N or I
• Character variables begin with the
character C. Keywords may be specified in
upper or lower case and may be shortened
to four characters
• Other variables are REAL
• Arrays end with the keyword ´RAY´
Helmut Michels, MPI für Sonnensystemforschung
11
Initialization and Termination
• Initialization:
CALL DISINI ()
• Termination:
CALL DISFIN ()
• Termination of
an axis system:
CALL ENDGRF ()
Helmut Michels, MPI für Sonnensystemforschung
12
Plotting Text and Numbers
•
•
•
•
•
•
•
•
•
•
MESSAG (CSTR, NX, NY)
NUMBER (X, NDEZ, NX, NY)
SYMBOL (NSYM, NX, NY)
HEIGHT (NH)
ANGLE (NANG)
plots text
plots a number
plots symbols
sets the character height
defines the character
angle
COMPLX, SIMPLX, DUPLX, define vector fonts
SERIF, HELVE, HELVES
PSFONT (CFNT)
defines PostScript fonts
BMPFNT (CFNT)
defines a bitmap font
WINFNT (CFNT)
defines a Windows font
X11FNT (CFONT, COPT)
defines an X11 font
Helmut Michels, MPI für Sonnensystemforschung
13
Axis Systems and Titles
• GRAF (XA, XE, XOR, XSTP,
•
•
•
•
•
•
•
•
•
YA, YE, YOR, YSTP)
POLAR (XE, XOR, XSTP,
YOR, YSTP)
TITLE ()
AXSPOS (NXA, NYA)
AXSLEN (NXL, NYL)
TICKS (N, CAX)
LABELS (CSTR, CAX)
NAME (CSTR, CAX)
AXSSCL (COPT, CAX)
TITLIN (CSTR, I)
plots an axis system
plots a polar axis system
plots a title
defines the position
defines axis lengths
sets the number of ticks
defines axis labels
sets axis titles
defines the axis scaling
defines text for titles
Helmut Michels, MPI für Sonnensystemforschung
14
Plotting Curves
• CURVE (XRAY, YRAY, N)
plots curves
•
•
•
•
•
•
selects symbols or lines
defines a symbol
sets the size of symbols
sets an interpolation method
defines curve thickness
sets attributes that will be automatically
changed by CURVE
defines line styles
sets a colour
INCMRK (NMRK)
MARKER (NHSYMB)
HSYMBL (NH)
POLCRV (COPT)
THKCRV (N)
CHNCRV (COPT)
• LINTYP (N)
• COLOR (COPT)
Helmut Michels, MPI für Sonnensystemforschung
15
Plotting Curves / Example
Helmut Michels, MPI für Sonnensystemforschung
16
Parameter Setting Routines
• Basic routines (resetting, file format, page control, error handling, viewport
•
•
•
•
•
•
•
•
•
•
•
•
control)
Axis systems (type, position, size, scaling, labels, ticks, titles, colours, clipping)
Colours (foreground, colour tables, utility routines)
Text and numbers
Fonts, alphabets
Indices and exponents
Instruction alphabet
TeX instructions for mathematical formulas
Curve attributes
Line attributes
Shading
Base transformations
Shielded regions
Helmut Michels, MPI für Sonnensystemforschung
17
Elementary Plot Routines
•
•
•
•
•
•
•
•
•
MESSAG (CSTR, NX, NY)
NUMBER (X, NDEZ, NX, NY)
SYMBOL (NSYM, NX, NY)
LINE (NX, NY, NU, NV)
RECTAN (NX, NY, NW, NH)
CIRCLE (NX, NY, NR)
ELLIPS (NX, NY, NA, NB)
VECTOR (NX, NY, NU, NV, IVEC)
AREAF (NXRAY, NYRAY, N)
• RLMESS, RLNUMB, RLSYMB,
RLINE, RLREC, RLCIRC,
RLELL, RLVEC, RLAREA
plots text
plots numbers
plots symbols
plots a line
plots rectangles
plots circles
plots ellipses
plots vectors
plots polygons
are analogous routines for
user coordinates
Helmut Michels, MPI für Sonnensystemforschung
18
Business Graphics / Bar Graphs
• BARS (XRAY, Y1RAY,
plots bar graphs
Y2RAY, N)
• BARTYP (COPT)
• BARWTH (XWTH)
• LABELS (COPT, ´BARS´)
• LABPOS (COPT, ´BARS´)
• LABDIG (N, ´BARS´)
• LABCLR (NCLR, ´BARS´)
defines vertical or
horizontal bars
defines the width of bars
sets labels
defines the position of
labels
sets the number of
decimal places in labels
defines the colour of
labels
Helmut Michels, MPI für Sonnensystemforschung
19
Business Graphics / Pie Charts
• PIEGRF (CBUF, NLIN,
plots pie charts
XRAY, N)
• PIETYP (COPT)
• LABELS (COPT, ´PIE´)
• LABPOS (COPT, ´PIE´)
• LABDIG (N, COPT)
• LABCLR (NCLR, ´PIE´)
• PIECLR (N1RAY, N2RAY, N)
• PIEEXP ()
defines 2-D or 3-D pie
charts
defines labels
sets the position of labels
sets the number of
decimal places in labels
sets the colour of labels
defines colours for single
pies
enable exploded pies
Helmut Michels, MPI für Sonnensystemforschung
20
Business Graphics / Example
Helmut Michels, MPI für Sonnensystemforschung
21
3-D Colour Graphics
• GRAF3 (XA, XE, XOR, XSTP,
•
•
•
•
•
•
•
•
YA, YE, YOR, YSTP,
ZA, ZE, ZOR, ZSTP)
CURVE3 (XRAY, YRAY, ZRAY, N)
CRVMAT (ZMAT, NX, NY,
IXP, IYP)
CRVTRI (XRAY, YRAY, ZRAY, N,
I1RAY, I2RAY, I3RAY, NTRI)
SETRES (NW, NH)
SHDMOD (COPT, ‘CURVE’)
AX3LEN (NXL, NYL, NZL)
WIDBAR (NW)
NOBAR ()
• COLRAN (NCA, NCE)
plots a 3-D axis system where the
Z-axis is plotted as a colour bar
plots data points
plots a coloured surface
according to a matrix
plots the surface of a Delaunay
triangulation
defines the size of rectangles
selects symbols or rectangles
defines axis lengths
sets the width of colour bars
suppresses the plotting of the
colour bar
defines the range of colours used
for colour bars
Helmut Michels, MPI für Sonnensystemforschung
22
3-D Colour Graphics / Example
Helmut Michels, MPI für Sonnensystemforschung
23
3-D Graphics / Axis System
• GRAF3D (XA, XE, XOR, XSTP,
plots an axis system
YA, YE, YOR, YSTP,
ZA, ZE, ZOR, ZSTP)
• GRID3D (NX, NY, COPT)
• AXIS3D (XLEN, YLEN, ZLEN)
• VIEW3D (XVU, YVU, ZVU, COPT)
• VFOC3D (XFOC, YFOC, ZFOC,
• VUP3D (ANG)
• ANG3D (ANG)
plots a grid in the 3-D box
defines the lengths of the 3-D
box
sets the viewpoint
defines the focus point
COPT)
defines the rotation of the
camera around the viewing axis
specifies the field of view of the
lens
Helmut Michels, MPI für Sonnensystemforschung
24
3-D Graphics / Plotting Data
• CURV3D (XRAY, YRAY, ZRAY, N)
• SURFCE (XRAY, N, YRAY, M,
•
•
•
•
•
•
•
plots curves
plots a surface grid of a matrix
ZMAT)
SURFUN (ZFUN, IXP, XDEL,
plots a surface grid of a function
IYP, YDEL)
SURSHD (XRAY, NX, YRAY, NY,
plots a shaded surface from a
ZMAT)
matrix
SURFCP (ZFUN, TMIN, TMAX, TSTP, plots a surface of a parametric
UMIN, UMAX, USTP) function
SURTRI (XRAY, YRAY, ZRAY, N,
plots a surface of triangulated
I1RAY, I2RAY, I3RAY, NTRI)
data
SURISO (XRAY, NX, YRAY, NY,
plots isosurfaces of the form
ZRAY, NZ, WMAT, WLEV)
f (x, y, z) = constant
BARS3D (XRAY, YRAY, Z1RAY, plots three-dimensional bars
Z2RAY, XWRAY, YWRAY, ICRAY, N)
Helmut Michels, MPI für Sonnensystemforschung
25
3-D Graphics / Example
Helmut Michels, MPI für Sonnensystemforschung
26
Geographical Projections
• GRAFMP (XA, XE, XOR, XSTP,
plots a geographical axis system
YA, YE, YOR, YSTP)
•
•
•
•
CURVMP (XRAY, YRAY, ZRAY, N)
WORLD ()
SHDMAP (CMAP)
PROJCT (COPT)
• MAPBAS (CBAS)
• MAPFIL (CFIL)
• SETCBK (Routine, ‘MYPR’)
plots curves
plots coastlines and lakes
plots shaded continents
selects the geographical
projection
defines the used map data base
defines an external map file
enables an user-defined
projection
Helmut Michels, MPI für Sonnensystemforschung
27
Geogr. Projections / Example
Helmut Michels, MPI für Sonnensystemforschung
28
Contouring
• CONTUR (XRAY, N, YRAY, M,
•
•
•
•
ZMAT, ZLEV)
CONMAT (ZMAT, N, M, ZLEV)
CONTRI (XRAY, YRAY, ZRAY, N,
I1RAY, I2RAY, I3RAY, NTRI, ZLV)
CONSHD (XRAY, N, YRAY, M,
ZMAT, ZLVRAY, NLV)
CONFLL (XRAY, YRAY, ZRAY, N,
I1RAY, I2RAY, I3RAY, NTRI,
ZLVRAY, NLV)
• LABELS (COPT, ‘CONTUR’)
• SHDMOD (COPT, CKEY)
plots contours
of the function Z=F(X,Y)
plots contours
plots contours from
triangulated data
plots filled contours of
the function Z = F(X, Y)
plots filled contours
from triangulated data
defines labels for contours
selects the algorithm used for
contour filling
Helmut Michels, MPI für Sonnensystemforschung
29
Contouring / Example
Helmut Michels, MPI für Sonnensystemforschung
30
Widget Routines
•
•
•
•
•
•
•
•
•
•
•
WGINI (COPT, ID)
WGFIN ()
WGBAS (IP, COPT, ID)
WGLAB (IP, CSTR, ID)
WGBUT (IP, CLAB, IV, ID)
WGTXT (IP, CSTR, ID)
WGFIL (IP, CLAB, CFIL,
CMASK, ID)
WGLIS (IP, CLIS, ISEL, ID)
WGSCL (IP, CLAB, XMIN,
XMAX, XVAL, NDEZ, ID)
WGDRAW (IP, ID)
WGPBUT (IP, ID)
creates a main widget
terminates the widget routines
creates a container widget
creates a label widget
creates a button widget
creates a text widget
creates a file widget
creates a list widget
creates a scale widget
creates a draw widget
creates a push button widget
Helmut Michels, MPI für Sonnensystemforschung
31
Widget Routines / Example
Helmut Michels, MPI für Sonnensystemforschung
32
Quick Plots
• QPLOT (XRAY, YRAY, N)
curve plot
• QPLSCA (XRAY, YRAY, N)
scatter plot
• QPLBAR (XRAY, N)
plots a bar
graph
•
•
•
•
QPLPIE (XRAY, N)
QPLCLR (ZMAT, NX, NY)
QPLSUR (ZMAT, N, M)
QPLCON (ZMAT, N, M, NLV)
plots a pie chart
3-D colour plot
surface plot
contour plot
Helmut Michels, MPI für Sonnensystemforschung
33