gnuplot contours

Michael Shapiro shapiro at zorro.cecer.army.mil
Sun Mar 15 11:54:19 EST 1992


(1) Use r.stats to output the z values. r.out.ascii is  too  hard
to manipulate using awk if the lines are long.

(2) r.stats -1qx will output z values with x,y coordinates:


      1 1 10
      1 2 11
      1 3 15
	.
	.
	.
      100 1 43
      100 2 44
	.
	.
	.

This form appears to be what splot wants in parametric mode

(3) r.stats -1q will output just z values. You will need to write
a   script   to   add  blank  lines  between  rows  of  data  for
nonparametric splot. This two line shell  script  should  do  the
trick:

    #!/bin/sh
    cols=`g.region | awk '/cols/{print $2}'`
    r.stats -1q $1 | awk 'NR%cols==0{print ""};{print}' cols=$cols

Note,  this  depends  on  your  version  of  awk  accepting   the
cols=number  on  the  command  line. Not all versions of awk will
accept it.

(4) Note - I haven't tried gnuplot with splot yet. I just  wanted
to disseminate these ideas so other could try.

-----------------------------------------------------------------
Michael Shapiro                        U.S. Army CERL                  
email:   shapiro at zorro.cecer.army.mil  Environmental Division          
phone:   (217) 352-6511  ext 526       P.O. Box 9005                   
fax:     (217) 373-7222                Champaign, Ill. 61826-9005
-----------------------------------------------------------------



More information about the grass-user mailing list