cd /home/SHARE manpsE.txt prog/prtps -p lib/man/manpsE.txt | lpr ~~~~~~~~~~ prog/prtps -p=6 lib/man/manpsE6.txt | lpr -P ph8200 prog/prtps -p=8 lib/man/manpsE8.txt | lpr -P ph8200 [Library Archive File] path : /home/SHARE/lib/libgm.a [Useful Setting] alias cc 'gcc \!* -L/home/SHARE/lib -lgm -lm' alias f77 'g77 \!* -L/home/SHARE/lib -lgm' LINE Graphics PostScript Output ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ NAME psopn - Open PostScript(PS) output file plots - Start a PS page plote - End a PS page pscls - Close PS output file SYNOPSIS call psopn(pfile, sheet) pfile PS filename to create or renew If NULL string, PostScript data are output to STDOUT. sheet Define sheet size (3 characters) 1st char: 'A' | 'B'; 2nd char: '4' | '3' | '2' | '1' | '0'; 3rd char: 'P'/'L'; (P: portrait, L: landscape) 4th char 'E' may be added for EPS output ) call plots(xo, yo) xo, yo Initial origin of coordinates (in cm) call plote call pscls ---------------- NAME plot - Move pen to specified point with/without drawing may change origin scisor - Define valid range to draw (no effect on 'wcirc'/'wrect') factor - Define scaling factor to draw penatr - Define line specification to a pen number There are 8 pen numbers 1-8. Pens 1-4 are initially specified as black solid line with thickness 0.01 / 0.03 / 0.06 / 0.10 cm, while pens 5-8 black broken lines. newpen - Specify pen number to use where - Inform pen location and scaling factor SYNOPSIS call plot(xp, yp, md) xp, yp Coordinates (in cm) of point where to move md If +2 or -2, draw line to (xp,yp), else only move. If minus, origin is changed to the point. call scisor(xl, yl, xsz, ysz) xl, yl Bottom left corner coordinates (in cm) of scisoring range xsz Width (in cm) of scisoring range ysz Height (in cm) of scisoring range If xsz = ysz = 0., scisoring is disabled. call factor(fac) fac Scaling factor If specified, actual drawing is magnified/reduced by this factor. call penatr(jpen, icol, ityp, thick) jpen Pen number (1-8) to define specification icol Color value (RGB color or Gray level) 0 thru 16777215 : 24bit color code, 8 bit each for R,G,B 0 thru -255 : monochromatic gray level from black to white [ 0 : black ; -255,16777215 : white] ityp Line species [ 0: solid; 1: broken; 2: dotted; 3: chained ] thick Line thickness (in cm) Selecting jpen=0 may be used to define temporal definition of line specification, which is valid until redefinition of pen number by `call penatr(0, ... )` or `call newpen(n)`. call newpen(npen) npen Select pen number (1-8) to use drawing call where(xw, wy, wfac) wx, wy Variables in which coordinates of pen location are given wfac Variable in which current scaling factor is given ---------------- NAME wrect - Draw a rectangle along axes wpolyg - Draw a polygon wcirc - Draw a circle/arc using current pen specification SYNOPSIS call wrect(xl, yl, xsz, ysz) xl, yl Coordinates (in cm) of base point (usually lower left corner) of the rectangle. xsz Width (in cm) If minus, drawn on the left side of base point. ysz Height (in cm) If minus, drawn on the bottom side of base point. call wpolyg(xm, ym, npt, inc) xm, ym Arrays containing coordinates of polygon corners npt Number of corners (must be 3 or higher) inc Increment to retrieve coordinates data (must be positive) call wcirc(xc, yc, ra, a1, a2) xc, yc Coordinates (in cm) of circle center ra Radius (in cm) a1, a2 Starting and ending angle (in degrees) Angles are measured counterclockwise from +X (to right) direction. If a1>a2, no circle/arc is drawn. SURFACE Graphics PostScript Output ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ NAME dftone - Define and assign monochromatic gray-scale grading for 2D surface representation 'paintm' dfrgbt - Define and assign color grading for 2D surface representation 'paintm' dfcols - Auto-generate and assign color grading for 2D surface representation 'paintm', and also auto-generate shaded color grading for dual 2D surfaces representation 'paintw' dframe - Define the frame of 2D surface representation by 'paintm' / 'paintw' paintm - Represent 2D surface with gray-scale or color grading of rasterized data paintw - Represent dual 2D surfaces with shaded color grading of rasterized data dresol - Modify the resolution of 'paintm' / 'paintw' representation SYNOPSIS call dftone(nlevel, mtone, ktnlo, ktnhi, ktnvd) nlevel Number of gray-scale grading levels (no more than 50) mtone Array defining gray-scales of grading ktnlo Gray-scale to be assigned to values less than lower bound ktnhi Gray-scale to be assigned to values more than upper bound ktnvd Gray-scale to be assigned to no-data area If ktnvd>255 or 0>ktnvd, white (ktnvd=255) is assumed. Gray-scale should be 0 - 255, indicating the brightness. [ 0: black; 255: white ] If nlevel=0, other arguments (mtone,ktnlo,ktnhi,ktnvd) are not effective, and a default setting with 20 levels grading is adopted. call dfrgbt(nclev, mrgb, kclo, kchi, kcnv) call dfcols(nclev, hue, dark, kcnv) nclev Number of color grading levels (no more than 50) mrgb Array defining color codes of grading kclo Color code to be assigned to values less than lower bound kchi Color code to be assigned to values more than upper bound kcnv Color code to be assigned to no-data area If ktnvd>16777215 or 0>ktnvd, white is assumed. hue Factor (0.2 - 1.2) of how wide range of hue to use, in auto-generating color grading tables. dark Factor (0. - 1.6) of how wide range of brightness to use, in auto-generating color grading tables, which controls the darkness of colors to be assigned to values near both end bounds in 2D surface representation 'paintm', and the range of brightness contrast in dual 2D surfaces representation 'paintw'. Color code should be 0 - 16777215, 24 bit non-negative integer, each 8 bit of which is attributed to Red/Green/Blue light intensity. [ 0: black; (255*256+255)*256+255=16777215: white ] If nlevel=0, other arguments (mrgb,kclo,kchi,kcnv or hue,dark,kcnv) are not effective, and a default setting with 20 levels color grading is adopted, which is equivalent to `call dfcols(20, 1., 1., -1)`. call dframe(xo, yo, wd, hi, imax, jmax) xo, yo Coordinates (in cm) of base (usually bottom left) corner of the rectangular frame to paint by 'paintm' or 'paintw'. wd Width (in cm) of the frame hi Height (in cm) of the frame imax, jmax Number of grids to the right and to the top, counting both ends, which also specify the dimensions of adjustable array. In usual case, imax>0 and jmax>0, the array declaration is like `dimension v(imax,jmax)`, where array elements are ordered toward right first and then to top. If array elements are ordered to top and then toward right, both imax and jmax shall be given as negative values, where the array declaration is supposed to be like `dimension v(-jmax,-imax)`. call paintm(v, vlo, vhi, vnvd) call paintw(v, vlo, vhi, vnvd, u) v 2D array defining grid data (imax*jmax elements in total) vlo Lower bound for grid data to represent with color grading vhi Upper bound for grid data to represent with color grading vnvd Special value of grid data indicating no-data area u 2D array defining supplemental grid data (imax*jmax elements in total) for shading. The values in this array must be noramlized to the range of 0.-1. in advance. The number of grading levels in shading is fixed to 20. call dresol(nras) nras The resolution shall be changed to ((nras) / 8) times of pre-defined value. This is effective to the later 'dframe' definition. ---------------- NAME dfpcol - Assign a color to paint an object paintc / paintr / paintp - Paint a circle / rectangle / polygon SYNOPSIS call dfpcol(key, mcol) key Select gray-scale (0), color code (1), or grading level (2) mcol If key=0, specify gray-scale (0-255). If key=1, specify color code (0-16777215), though the selection of -1 thru -255 for mcol is acceptable, which is equivalent to positive value gray-scale. If key=2, specify color by grading level number in currently effective gray-scale or color grading. call paintc(xc, yc, radius) xc, yc Coordinates (in cm) of center of the circle to be painted radius Radius (in cm) call paintr(xorg, yorg, wide, high) xorg, yorg Coordinates (in cm) of base point (usually bottom left corner) of the rectangle to be painted. wide Width (in cm) If minus, painted on the left side of base point. high Height (in cm) If minus, painted on the bottom side of base point. call paintp(xa, ya, npt, inc) xa, ya Arrays containing coordinates of corners of the polygon to be painted npt Number of corners (must be 3 or higher) inc Increment to retrieve coordinates data (must be positive) The dicision of painting in complicated cases is base on the "non-zero winding number rule", i.e., under the condition that the number of times wound counterclockwise subtracted by the number wound clockwise is not zero. EXAMPLE c ***** Sample ***** dimension f(151,101) dimension g(2,2), h(2,2), xm(9), ym(9), pos(2,4), q(3,2) data g / -110., -110., +110., +110./, h / 0., 1., 0., 1./, * xm / 0.0, 0.0, 2.5, 0.5, 1.5, 2.5, 0.5, 3.0, 3.0 /, * ym / 0.0, 3.0, 2.0, 1.0, 0.5, 1.0, 2.0, 3.0, 0.0 /, * pos/ 5.,0., 5.,2., 8.,0., 8.,2. /, * q / 0., 1., 2., 1., 2., 0. / do 100 i=1,151 x = float(i-76) a = float(i-86) do 100 j=1,101 y = float(j-51) b = float(j-31) r = sqrt(x*x + y*y) s = sqrt(a*a + b*b) f(i,j) = r*3. - s*2. + 17. if(r.gt.50.) f(i,j) = 999. 100 continue call psopn('pspaint.ps', 'a4p') call plots(3., 3.) call dfcols(0) call dframe(0., 12., 15., 10., 151, 101) call paintm(f, -80., 120., 999.) call newpen(3) call wrect(0., 12., 15., 10.) call dfpcol(1, 255*256*256) call paintr(2., 19., 3., 3.) call dframe(10., 0., 5., 10., 2, 2) call paintw(g, -100., 100., 999., h) call dfpcol(0, 200) call paintp(xm, ym, 9, 1) call newpen(2) call plot(xm(9), ym(9), 3) do 9 i=1,9 call plot(xm(i), ym(i), 2) 9 continue call paintp(pos(1,1), pos(2,1), 4, 2) call dftone(0) call dframe(0., 5., 8., 4., 3, 2) call paintm(q, 0., 2., 99.) call dfpcol(1, 255*256+255) call paintc(2., 7., 0.7) call plote call pscls stop end ***** Output from Sample Program ***** :/home/SHARE/lib/man/pspaint.ps Font TEXT Graphics PostScript Output ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ NAME sytle - Select font, size, direction, color of text string to draw, and background color to paint ptext - Draw text string The string can be aligned left, right or center, with/without background color painting. pcstr - Draw Courier font string in black SYNOPSIS call lstyle(font, high, angle, itcol, ibcol) font Character string defining literal font style (3 chars or less. 4th char and the behind are neglected.) 1st char: 'T'|'H'|'C'|'S'|'K'|'M'|'G' (may be a small letter), which stands for Times | Helvetica | Courier | Symbol | Kanji | Mincho | Gothic , where Mincho and Gothic are equivalent to (Kanji & Fine) and (Kanji & Bold), respectively. 2nd/3rd char: modifiers (may be a small letter) 'B' (Bold) / 'F' (Fine: disable bold) 'O','I' (Oblique,Italic) / 'N','R' (Normal,Roman) Others have no effect. If conflicting each other, the latter is effective. (e.g.) 'Mincho' : 'cho' is neglected, 'i' is overridden by 'n', then as a result (Kanji & Fine & Normal). 'Courier': 'rier' is neglected, 'u' has no effect, then as a result (Courier & Fine & Oblique). high Height (in cm) describing the font size Actual character size is dependent on the font, the ratio of actual size to the specified height is about 85% for Kanji fonts, about 70% for Times and Helvetica, and about 60% for Courier. The range of background color painting is 125% of the height specified, 100% above baseline and 25% below baseline. angle Direction angle to draw text (in degrees from +X axis) itcol Color of text ibcol Color of background Color values for itcol, and ibcol : 0 thru 16777215 : 24bit color code, 8 bit each for R,G,B 0 thru -255 : monochromatic gray level from black to white [ 0 : black ; -255,16777215 : white] If itcol is out-of-range, black color is assigned for text color. If ibcol is out-of-range (for example ibcol=-999), the background is ragarded as colorless transparent, i.e., rectanglar background painting is not performed. call ptext(text, ltxt, xp, yp, kp) text Text string to be drawn with pre-selected font ltxt Length (number of bytes) of text string xp, yp Coordinates (in cm) of base point to draw string kp If kp=0, string (lower left) is started at the base point. If kp=1, string (lower right) is ended at the base point. If kp=2, middle center of string is adjusted to the base point (xp,yp). Else (kp>2 or 0>kp), same as kp=0. call pcstr(xp, yp, chi, str, angle, ns) xp, yp Coordinates (in cm) of base point to draw string chi Height (in cm) of effective character size [different from 'high' specification in 'lstyle'] str Text string to be drawn with Courier font angle Direction angle to draw text (in degrees from +X axis) ns Number of bytes of text string If given as positive value, string (lower left) is started from the base point (xp,yp). If given as negated value, end point (lower right) of the string is adjusted to the base point (xp,yp). EXAMPLE parameter (iwhite = -255, igray = -128, iblack = 0, none = -999) parameter (iblue = 255, iyellow = (255*256 + 255) * 256) call psopn('ptext.ps', 'A4P') call plots(3., 2.) call dfpcol(0, 200) call paintr(0., 0., 15., 9.) call lstyle('HB', 1., 0., iblack, none) call ptext('Helvetica-Bold', 14, 1., 7., 0) call lstyle('ti', 1., 30., iwhite, iblack) call ptext('Times-Italic', 12, 12., 7., 2) call pcstr(15., 6., 1., 'Courier', 30., -7) call lstyle('Kbi', 1., 0., iyellow, igray) call ptext('Testテスト', 10, 6., 4., 1) call ptext('Testテスト', 10, 6., 4., 2) call lstyle('M', 1., 180., iblue, iwhite) call ptext('Testテスト', 10, 6., 2., 0) call lstyle('S', 1.5, 0., iblack, iyellow) call ptext('W=abc', 5, 9.5, 1., 0) call plote call pscls stop end :/home/SHARE/lib/man/ptext.ps 1 NOTES List of 'Symbol' fonts refered to ASCII character :/home/SHARE/lib/man/ptext.ps 2 Centered Symbol Graphics PostScript Output ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ NAME pmark - Draw a centered symbol mark SYNOPSIS call pmark(mark, xp, yp, size, thick, icol) mark Mark identifier (0-9) Refer to EXAMPLE for each mark shape. If mark>9 or 0>mark, black solid circle of 'size' dimension is assumed (equivalent to mark=0, thick=0., and icol=0). xc, yc Coordinates (in cm) of center of the mark to be drawn size Dimension (in cm) of mark thick Line thickness (in cm) to draw mark If thick=0., it has special meaning 'solid' for mark identifier 0 thru 6, the inside of the mark is painted with the color specified, and further the inside of inner circle in case of mark=1 is painted with white. icol Color of mark 0 thru 16777215 : 24bit color code, 8 bit each for R,G,B 0 thru -255 : monochromatic gray level from black to white [ 0 : black ; -255,16777215 : white] If icol is out-of-range (icol>16777215 or -255>icol), black color (icol=0) is assigned. EXAMPLE character mark*2 call psopn('ptext.ps', 'a4p') call plots(2.5, 2.) call dfpcol(1, -200) call paintr(0., 0., 15.5, 4.8) do 1 i=0,9 x = float(i)*1.5 + 1. write(mark,'(i2)') i call pcstr(x-0.5, 4.2, 0.3, mark, 0., 2) call pmark(i, x, 3.4, 1., 0.1, -255) call pmark(i, x, 2.1, 1., 0.03, 0) call pmark(i, x, 0.8, 1., 0. , -128) 1 continue call plote call pscls stop end :/home/SHARE/lib/man/ptext.ps 3 Drawing Graphic (Line) CONTOUR Map ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ NAME conts - Specify the framework of 2D contouring 'contx' contx - Execute contour map drawing 2D array data with arbitrary dimension size is represented into contour map of normal and capital lines, with respective specified line types. Only capital lines are drawn where the contour is crowded. Contour values are assigned at both end of capital lines (at one place if the line is closed). Memory area for the work is allocated dynamically. SYNOPSIS call conts(xorg, yorg, wide, high, imax, jmax, csize) xorg, yorg Coordinates (in cm) of base point to draw contour map wide Width (in cm) of the contour map If minus, drawn on the left side of base point. high Height (in cm) of the contour map If minus, drawn on the bottom side of base point. imax, jmax Number of grids to the right and to the top, counting both ends, which also specify the dimensions of adjustable array. In usual case, imax>0 and jmax>0, the array declaration is like `dimension v(imax,jmax)`, where array elements are ordered toward right first and then to top. If array elements are ordered to top and then toward right, both imax and jmax shall be given as negative values, where the array declaration is supposed to be like `dimension v(-jmax,-imax)`. In any case, even if wide<0. and/or high<0., v(1,1) is attributed to the base point (xorg,yorg). csize Character size (in cm) of contour value drawing If zero or negative, contour values are not drawn. call contx(v, undef, istep, lcapt, lml, lmh, kln) v 2D array defining grid data (imax*jmax elements in total) undef Special value of grid data indicating no-data area istep Contour interval (must be positive integer) lcapt Capital line interval ratio (m). Capital lines are placed every m-th line of contours. If given as negative value, all contours are drawn even where crowded contours. lml, lmh Lower and upper bound of contour values to draw contours (must be integers) kln Specify line type of contours (0-16) For capital contours, 0: solid, 1: broken, 2: dotted, 3: chained line; 4-6: solid line; 7-9: none (no lines drawn); 10-16: same as 0-6 but using pen number 2. For normal contours, 0: solid, 1: broken, 2: dotted, 3: chained line; 4,7: broken, 5,8: dotted, 6,9: chained line; 10-16: same as 0-6 but using pen number 1. Refer to 'newpen' for pen number selecting. In any case, the pen number selected before drawing contour map is recovered at the end of contouring. EXAMPLE dimension f(151,101) do 100 i=1,151 x = float(i-76) a = float(i-86) do 10 j=1,101 y = float(j-51) b = float(j-31) r = sqrt(x*x + y*y) s = sqrt(a*a + b*b) f(i,j) = r*3. - s*2. + 17. if(r.gt.50.) f(i,j) = 999. 100 continue call psopn('cont.ps', 'a4p') call plots(0., 0.) call wrect(3., 2., 15., 10.) call conts(3., 2., 15., 10., 151, 101, 0.12) call contx(f, 999., 1, 5,-100, -11, 0) call contx(f, 999., 1, 5, -10, 0, 10) call contx(f, 999., 1, 5, 1, 25, 11) call contx(f, 999., 1, 5, 26, 50, 14) call contx(f, 999., 1, 5, 51, 75, 2) call contx(f, 999., 1, 5, 76, 100, 12) call contx(f, 999., 1, 5, 101, 200, 3) call plote call pscls stop end :/home/SHARE/lib/man/cont.ps