# bars5a

How to download and try this example
Another example of stacked clustered bars

    Usage: pl -gif bars5a.htm

    // An example of stacked clustered bars
    // Bar labels are defined explicitly and positioned below X axis.
    //
    // Thanks to Michael D. Beynon beynon@cs.umd.edu

    #proc page
    #if @DEVICE in gif,png
      scale: 0.7
    #endif

    #proc areadef
    rectangle: 1 1 7 2
    xrange: 0 5
    yrange: 0 800

    #proc xaxis
    label: Dataset File Partitioning / Query
    labeldetails: adjust=0,-0.1
    tics: none
    stubdetails: adjust=0,-0.05
    stubs: text
     1 x 1
     2 x 2
     3 x 3
     4 x 4

    #proc yaxis
    label: Response\nTime (sec)
    labeldistance: 0.7
    stubs: inc 100
    grid: color=gray(0.8)
    stubformat: %.0f

    #proc getdata
    data:
    // all data for a cluster on a single line
    // q1{load process} q2{load process} ... q5{load process}
    102.764 574.528 102.537 575.402 105.689 616.259 102.419 577.465 103.056 575.349
    105.063 266.287 103.941 209.42 102.04 247.052 103.592 243.959 103.141 650.737
    106.54 131.715 109.641 146.441 104.805 132.238 105.789 151.606 108.208 199.669
    126.909 58.46 123.953 48.556 125.684 55.596 131.004 51.73 147.288 40.398

    #procdef bars
    color: rgb(.8,.6,.6)
    #saveas BAR1

    #procdef bars
    color: rgb(.9,.6,.6)
    labeldetails: size=6
    labelpos: 0(s)-0.1
    #saveas BAR2

    // q1
    #proc bars
    #clone BAR1
    lenfield: 1
    cluster: 1 / 5
    legendlabel: load

    #proc bars
    #clone BAR2
    lenfield: 2
    cluster: 1 / 5
    stackfields: 1
    legendlabel: process
    labelword: q1

    // q2
    #proc bars
    #clone BAR1
    lenfield: 3
    cluster: 2 / 5

    #proc bars
    #clone BAR2
    lenfield: 4
    cluster: 2 / 5
    stackfields: 3
    labelword: q2

    // q3
    #proc bars
    #clone BAR1
    lenfield: 5
    cluster: 3 / 5

    #proc bars
    #clone BAR2
    lenfield: 6
    cluster: 3 / 5
    stackfields: 5
    labelword: q3

    // q4
    #proc bars
    #clone BAR1
    lenfield: 7
    cluster: 4 / 5

    #proc bars
    #clone BAR2
    lenfield: 8
    cluster: 4 / 5
    stackfields: 7
    labelword: q4

    // q5
    #proc bars
    #clone BAR1
    lenfield: 9
    cluster: 5 / 5

    #proc bars
    #clone BAR2
    lenfield: 10
    cluster: 5 / 5
    stackfields: 9
    labelword: q5

    #proc legend
    location: max-.5 max
    reverseorder: yes
    seglen: 0.3