# teens

How to download and try this example

    Usage: pl -gif teens.htm
    Source: Newsweek 5/7/99.  Values interpolated from a graph and may not be exact.

    // set up plotting area using proc areadef
    #proc areadef
      title: Percent of teens who reported having\nsexual intercourse, 1995
      rectangle: 1 1 4 2
      xscaletype: categories
      xcategories:	15
    		16
    		17
    		18
    		19

      yrange: 0 100
      xaxis.stubs: usecategories
      xaxis.label: Age
      yaxis.stubs: inc 20
      yaxis.stubformat: %g%%
      yaxis.grid: color=limegreen

    // specify data using proc getdata
    #proc getdata
      //    age   females males
      data:
    	15	22	26
    	16	38	45
    	17	52	59
    	18	64	66
    	19	77	83

    // render pink bars using proc bars
    #proc bars
      locfield: 1
      lenfield: 2
      cluster: 1 / 2
      color: pink
      barwidth: 0.15
      clustersep: 0.03
      legendlabel: Female
      outline: no
      #saveas: A

    // render blue bars using proc bars
    #proc bars
      #clone: A
      lenfield: 3
      cluster: 2 / 2
      color: powderblue
      legendlabel: Male

    // render legend using the labels defined above (proc legend)
    #proc legend
      location: min+0.3 max-0.1