# Example 6color -- Plot IR image of Gulf of Maine

# define characteristics of norda images
\0val = "5"			# 0 in image
\255val = "30.5"		# 255 in image
.rows. = 128
.cols. = 128
.pixel_width. = 2
.km. = {rpn .cols. .pixel_width. *}

# get filenames
query \filename "Name image file" ("example6image.dat")
query \maskname "Name mask  file" ("example6mask.dat")

# get data
open \filename binary uchar
set image range \0val \255val
read image .rows. .cols. box 0 0 .km. .km.
close
open \maskname binary uchar
read image mask .rows. .cols.
close

# find out what grayscale method to use
query \minT  "T/deg for white on page?          " ("11")
query \maxT  "T/deg for black on page?          " ("14")
\incT = "1"

# set up scales. 
set x size 12.8
set y size 12.8
set x name "km"
set y name "km"
set x axis 0 .km. 32
set y axis 0 .km. 32

# plot image, grayscale, and histogram
set image colorscale hsb 0 1 1 \maxT hsb .6666666 1 1 \minT
draw image
draw image palette left \minT right \maxT increment \incT
draw image histogram
draw title "Example 6: colorscale"

