# Example 10 -- Draw color image plot

# Test various colorscales.
# INSTRUCTIONS: Uncomment one of the following '\scale = ' statements

# CASE 1: From black at high values to white at low values
#\scale = "rgb 0 0 0 20.0 rgb 1 1 1  0.0 increment 5"

# CASE 2: From skyblue at 20 to tan for 0; traverse RGB space
#         See also case 5, which names the colors.
#\scale = "rgb 0.529 0.808 0.922 20.0 rgb 0.824 0.706 0.549 0.0 increment 5"

# CASE 3: From skyblue at 20 to tan for 0; traverse HSB space
#         Is it just me, or is this uglier than case 2?
#\scale = "hsb 0.548 0.426 0.922 20.0 hsb 0.095 0.334 0.824 0.0 increment 5"

# CASE 4: Use a spectrum; traverse HSB space
#\scale = "hsb 0 1 1 20.0 hsb 0.6666 1 1  0.0 increment 5"

# CASE 5: From skyblue to tan, traversing RGB space (by default)
#         (Compare case 2, which uses similar endpoints, with
#         colors specified with RGB values, and larger increment.)
#\scale = "skyblue 20.0 tan 0.0 increment 2"

# CASE 6: From skyblue to tan, traversing RGB space (by default)
#         Compare 2 and 5; note this has continuous increment
#\scale = "skyblue 20.0 tan 0.0"

# CASE 7: From blue to brown
\scale = "blue 20.0 brown 0.0 increment 2.5"

open example10.dat
read line \header
read \D
read .nx.
read .ny.
set x name "distance along cove"
set y name "time"
set x grid 0 1 /.nx.
set x axis 0 1 0.5 0.1
set y grid 0 .ny. / .ny.
set y axis 0 .ny.
read grid data * * .ny. .nx.
set image range 0 20
convert grid to image 
set image colorscale \scale
draw image

# Draw contours in white ink
set graylevel 1.0
draw contour 0 20 1 unlabelled
set graylevel 0.0

draw axes			# redraw in case whited out 
draw image palette left -1 right 21 increment 5
set font size 9

# Title tells what method used
draw title "Used `draw image colorscale \scale'"
