return to first page linux journal archive
keywordscontents

Listing 1. Drawing Image Graphs

# Establish range stored in image.
set image range 4.9 30.4
# Set up a color scale ranging from blue at 4.9C 
# to red at 30.4C, in a spectrum. These endpoints
# are specified in HSB coordinates, where H is the
# hue, S the saturation and B the brightness. The
# HSB triplet 0.666 1 1 is saturated blue, and
# 0.000 1 1 is saturated red. We run over hues to
# get a spectrum. Note the use of backslash for 
# continuation across lines.
set image colorscale hsb 0.666 1 1  4.9 \
  hsb 0.000 1 1 30.4
# Read a 512by512 image that spans a box with x=0
# and y=0 at the lower-left corner and with x=20
# and y=20 at upper-right.
open temp.dat binary
read image 512 512 box 0 0 20 20
# Draw the image.
draw image