
// here is our example script.  each option for the question would have
// one plot showing the distribution of answers according to the answer
// to another question.

// specify data using proc getdata
#proc getdata
file:   CSplot.dat
select: @@1 = 2
showresults: yes

// here the data file is prenamed.  but the selection is tricky.
// we want the outer-loop data here, column N where N is the column 
// for the outer answer value 2.  oa is going to be 1 or 3.
// v is going to be each of its variants.

// set up plotting area using proc areadef
#proc areadef
  title: Male
  rectangle: 1 1 3 3.5
  yrange: 0 14
  xrange: 0 2177

// ansct is the count of answers for the inner q.
// resct is the max count of respondents for each answer.

// more substitutions here.

// render bars using proc bars
#proc bars
  horizontalbars: yes
  color: rgb(0,0.5,0.8)
  locfield: 4
  lenfield: 5
  barwidth: 0.25
  labeldetails: adjust=0,-0.03 color=rgb(0,0.5,0.8)
  colorlist: 4 red
  showvalues: yes

// render yaxis last so it is not obliterated, using proc yaxis
#proc yaxis:
  stubs: datafields 1
  tics: none
  axisline: none
  stubdetails: align=L  adjust=0.17,0.15
