begin temperature t
  # Define legend entries for various temperatures.
  #
  key "point", "temperature 20\260C", 20
  key "point", "temperature 25\260C", 25
  key "point", "temperature 30\260C", 30
  key "point", "temperature 35\260C", 35

  # Temperature is a value in range 20-35. Convert it to
  # a color in the range green-yellow-red.
  #
  color interpolate("20 green 25 yellow 35 red", t)
  box -2, -2, 2, 2
  fill
end

# Display map of Australia.   Then read temperature data from a file
# and display January temperatures for some cities, with different
# colors representing different temperatures.
#
newpage "eps", "tutorialattribute1.eps", 60, 40
dataset "shapefile", "coastline.shp", "dbffields="
worlds -2800000, 4800000, 2150000, 9190000
while Mapyrus.fetch.more
do
  fetch
  clearpath
  addpath GEOMETRY
  stroke
done
dataset "textfile", "aust_cities.dat", ""
while Mapyrus.fetch.more
do
  fetch
  let cityname = $1
  fetch
  let x = $1, y = $2
  clearpath
  move x, y
  fetch
  let januaryTemperature = $1
  temperature januaryTemperature
  fetch
done

# Draw legend in separate PostScript file.
#
newpage "eps", "tutorialattribute1legend.eps", 40, 50, \
  "isolatinfonts=Helvetica"
color "black"
move 5, 5, 5, 10, 5, 15, 5, 20
font "Helvetica", 2.5
legend 4
