DISLIN A Data Plotting Library by Helmut Michels
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, 3 D-colour plots, surfaces, contours and maps. Programming Languages: Fortran 77, Fortran 90/95, C, Perl, Python, Java Current Version: 11. 1 (Feb. 2018) 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 Post. Script, X 11 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-11. 1. xxx. tar. gz tar xvf dislin-11. 1. xxx. tar cd dislin-11. 1 export DISLIN=dislin_directory (i. e. /usr/local/dislin). /INSTALL • General settings: export DISLIN=dislin_directory LD_LIBRARY_PATH=$DISLIN: $LD_LIBRARY_PATH=$PATH: $DISLIN/bin Helmut Michels, MPI für Sonnensystemforschung 5
Installation Windows • unzip dl_11_xx. zip (temporary directory) • setup - choose ok - give the installation directory • Global settings (Control Panel): DISLIN=dislin_directory PATH=%PATH%; dislin_directorywin Helmut Michels, MPI für Sonnensystemforschung 6
Basic Concepts / Page Format • Default Page: • • • DIN A 4 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, GL 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 GRAF 3 or GRAF 3 D 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, GRAF 3 D) Plotting the title (TITLE) Plotting data points (CURVE, CURVE 3, CURV 3 D, 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, HELVES PSFONT (CFNT) defines Post. Script fonts BMPFNT (CFNT) defines a bitmap font WINFNT (CFNT) defines a Windows font X 11 FNT (CFONT, COPT) defines an X 11 font Helmut Michels, MPI für Sonnensystemforschung 13
Axis Systems and Titles • GRAF (XA, XE, XOR, XSTP, plots an axis system • • • 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 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 • • • INCMRK (NMRK) MARKER (NHSYMB) HSYMBL (NH) POLCRV (COPT) THKCRV (N) CHNCRV (COPT) • LINTYP (N) • COLOR (COPT) 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 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 Te. X 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, Y 1 RAY, plots bar graphs • BARTYP (COPT) 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 Y 2 RAY, N) • • • BARWTH (XWTH) LABELS (COPT, ´BARS´) LABPOS (COPT, ´BARS´) • LABDIG (N, ´BARS´) • LABCLR (NCLR, ´BARS´) Helmut Michels, MPI für Sonnensystemforschung 19
Business Graphics / Pie Charts • PIEGRF (CBUF, NLIN, plots pie charts XRAY, N) • PIETYP (COPT) • • • defines 2 -D or 3 -D pie charts LABELS (COPT, ´PIE´) defines labels LABPOS (COPT, ´PIE´) sets the position of labels LABDIG (N, COPT) sets the number of decimal places in labels LABCLR (NCLR, ´PIE´) sets the colour of labels PIECLR (N 1 RAY, N 2 RAY, N) defines colours for single pies PIEEXP () enable exploded pies Helmut Michels, MPI für Sonnensystemforschung 20
Business Graphics / Example Helmut Michels, MPI für Sonnensystemforschung 21
3 -D Colour Graphics • GRAF 3 (XA, XE, XOR, XSTP, 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 • • • YA, YE, YOR, YSTP, ZA, ZE, ZOR, ZSTP) CURVE 3 (XRAY, YRAY, ZRAY, N) CRVMAT (ZMAT, NX, NY, IXP, IYP) CRVTRI (XRAY, YRAY, ZRAY, N, I 1 RAY, I 2 RAY, I 3 RAY, NTRI) SETRES (NW, NH) SHDMOD (COPT, ‘CURVE’) AX 3 LEN (NXL, NYL, NZL) WIDBAR (NW) NOBAR () • COLRAN (NCA, NCE) Helmut Michels, MPI für Sonnensystemforschung 22
3 -D Colour Graphics / Example Helmut Michels, MPI für Sonnensystemforschung 23
3 -D Graphics / Axis System • GRAF 3 D (XA, XE, XOR, XSTP, plots an axis system YA, YE, YOR, YSTP, ZA, ZE, ZOR, ZSTP) • GRID 3 D (NX, NY, COPT) • AXIS 3 D (XLEN, YLEN, ZLEN) • • plots a grid in the 3 -D box defines the lengths of the 3 -D box VIEW 3 D (XVU, YVU, ZVU, COPT) sets the viewpoint VFOC 3 D (XFOC, YFOC, ZFOC, defines the focus point COPT) VUP 3 D (ANG) defines the rotation of the camera around the viewing axis ANG 3 D (ANG) specifies the field of view of the lens Helmut Michels, MPI für Sonnensystemforschung 24
3 -D Graphics / Plotting Data • CURV 3 D (XRAY, YRAY, ZRAY, N) • SURFCE (XRAY, N, YRAY, M, plots curves plots a surface grid of a matrix • plots a surface grid of a function • • • ZMAT) SURFUN (ZFUN, IXP, XDEL, IYP, YDEL) SURSHD (XRAY, NX, YRAY, NY, ZMAT) SURFCP (ZFUN, TMIN, TMAX, TSTP, UMIN, UMAX, USTP) SURTRI (XRAY, YRAY, ZRAY, N, I 1 RAY, I 2 RAY, I 3 RAY, NTRI) SURISO (XRAY, NX, YRAY, NY, ZRAY, NZ, WMAT, WLEV) BARS 3 D (XRAY, YRAY, Z 1 RAY, Z 2 RAY, XWRAY, YWRAY, ICRAY, N) plots a shaded surface from a matrix plots a surface of a parametric function plots a surface of triangulated data plots isosurfaces of the form f (x, y, z) = constant plots three-dimensional bars 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 • • 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 YA, YE, YOR, YSTP) CURVMP (XRAY, YRAY, ZRAY, N) WORLD () SHDMAP (CMAP) PROJCT (COPT) • MAPBAS (CBAS) • MAPFIL (CFIL) • SETCBK (Routine, ‘MYPR’) 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, I 1 RAY, I 2 RAY, I 3 RAY, NTRI, ZLV) CONSHD (XRAY, N, YRAY, M, ZMAT, ZLVRAY, NLV) CONFLL (XRAY, YRAY, ZRAY, N, I 1 RAY, I 2 RAY, I 3 RAY, NTRI, ZLVRAY, NLV) • LABELS (COPT, ‘CONTUR’) • SHDMOD (COPT, CKEY) plots contours of the function Z=F(X, Y) 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) WGPBAR (IP, XMIN, XMAX, XSTP, ID) WGTBL (IP, N, M, 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 creates a progress bar creates a table widget Helmut Michels, MPI für Sonnensystemforschung 31
Widget Routines / Example 1 Helmut Michels, MPI für Sonnensystemforschung 32
Widget Routines / Example 2 Helmut Michels, MPI für Sonnensystemforschung 33
Quick Plots • QPLOT (XRAY, YRAY, N) • QPLSCA (XRAY, YRAY, N) • QPLBAR (XRAY, N) • • curve plot scatter plots a bar graph QPLPIE (XRAY, N) plots a pie chart QPLCLR (ZMAT, NX, NY) 3 -D colour plot QPLSUR (ZMAT, N, M) surface plot QPLCON (ZMAT, N, M, NLV) contour plot Helmut Michels, MPI für Sonnensystemforschung 34
- Slides: 34