Gri: Write commands

Gri Commands 1: Introduction 2: Simple example 3: Fancy example 4: Running Gri 5: Programming Gri 6: General Issues 7: X-Y Plots 8: Contour Plots 9: Image Plots 10: Examples 11: Handling Data 12: Gri Commands 13: Gri Extras 14: Evolution of Gri 15: Installing Gri 16: Gri Bugs 17: System Tools 18: Acknowledgments 19: License 20: Newsgroup 21: Concept Index | ## 12.50: The ``write`' Command
    `write ... to \filename'
- Write some information to the indicate file, appending after any existing contents of that file. If the filename is ``stdout`', the information is written to the standard output device (ie, the screen); if it is ``stderr`', the information is written to the standard error device (ie, the screen). ``write columns to \filename`' Append data columns to the end of the indicated file. ``write contour .value. to \filename`' As corresponding ``draw contour`' command, but don't actually draw the contours; instead, write to the indicated file, starting at the EOF of the file if it is nonempty (thus, appending to the file). The first line of output is a header line, containing two numbers: the contour value and the missing value. Then the xy pairs are written a line at a time, with missing values being used to indicate ends of segments. A blank line is written after the last data pair. For example, if the contour contained two closed regions, Gri would output a pair of missing values as one of the xy pairs, to denote the separation of the two curves. You could read and plot the output as in this example
      write contour 10 to contour.out
      write contour 20 to contour.out
      open contour.out
      read .contour_value. .missing.
      set missing value .missing.
      read columns x y
      draw curve
``write grid to grid.dat [bycolumns]`' Append grid to the end of the named file. Storage is in ``%f`' format, and is in normal image order. If the keyword ``bycolumns`' is present, then the grid is transposed first, in such a way that ``read grid data bycolumns`' performed on that file will read back the original grid data. ``write image to image.dat`' Append image to the end of the named file. Storage is by unsigned-char, and is in normal image order. There is no header. ``write image rasterfile to image.dat`' Append image to the end of the named file, in Sun Rasterfile format. ``write image pgm to mask.dat`' Append image mask to the end of the named file, in PGM 'rawbits' format. ``write image mask to mask.dat`' Append image mask to the end of the named file. Storage is by unsigned-char, and is in normal image order. ``write image mask rasterfile to mask.dat`' Append image mask to the end of the named file, in Sun Rasterfile format. ``write image mask pgm to mask.dat`' Append image mask to the end of the named file, in PGM 'rawbits' format. ``write image colorscale to colorscale.dat`' Append image colorscale transform to the end of the named file. Storage is a series of 256 lines, each containing 3 numbers (for Red, Green and Blue) in the range 0 to 1. The file is suitable for reading with the ``read image colorscale`' command. ``write image grayscale to grayscale.dat`' Append image grayscale transform to the end of the named file. Storage is a series of 256 lines, each containing a number in the range 0 to 1. The file is suitable for reading with the ``read image grayscale`' command.