Loading ...
Sorry, an error occurred while loading the content.

A simple one

Expand Messages
  • borne52
    ploticus, Trying to make the world s simplest bar graph here, with this script: #proc getdata file: wine.dat showdata: yes delim: whitespace fieldnames: wine
    Message 1 of 2 , Nov 14, 2009
    • 0 Attachment
      ploticus,

      Trying to make the world's simplest bar graph here, with this script:

      #proc getdata
      file: wine.dat
      showdata: yes
      delim: whitespace
      fieldnames: wine score

      #proc areadef
      title: Wine Scores
      rectangle: 1 1 5 2
      //xrange: 0 30
      //yrange: 0 4
      xautorange: datafield=wine
      yautorange: datafield=score
      yaxis.stubs: incremental 1

      #proc bars
      lenfield: 1
      //color: rgb(.8,1,.7)
      //longwayslabel: yes
      //labeldetails: align=R adjust=0,-0.1

      When I run it I see:

      1026 ~/tmp>pl -png winebars.pl
      // proc getdata has read & parsed these data:
      // field names are: wine|score|
      Wine:1|3|
      Wine:2|2|
      Wine:3|2|
      Wine:4|3|
      Wine:5|2|
      Wine:6|1|
      Wine:7|3|
      Wine:8|4|
      Wine:9|1|
      Wine:10|1|
      Wine:11|3|
      Wine:12|2|
      Wine:13|2|
      Wine:14|3|
      Wine:15|2|
      Wine:16|1|
      Wine:17|3|
      Wine:18|4|
      Wine:19|1|
      Wine:20|1|
      Wine:21|3|
      Wine:22|2|
      Wine:23|2|
      Wine:24|3|
      Wine:25|2|
      Wine:26|1|
      Wine:27|3|
      Wine:28|4|
      Wine:29|1|
      Wine:30|2|
      // end of data set
      pl proc areadef: error 5709: autorange: all data out of range

      And the resulting *png has a y axis with 1,2,3,4, no x axis and no bars. I've a few different variations - what am I missing?

      Thanks again,

      BIO
    • Steve Grubb
      Hello, it looks like your x axis needs to be categories for what you re trying to do. See my edits below. -Steve ... axis: x datafield: wine ... xscaletype:
      Message 2 of 2 , Nov 17, 2009
      • 0 Attachment
        Hello, it looks like your x axis needs to be categories for what you're trying to do.  See my edits below.  -Steve


        On Sat, Nov 14, 2009 at 9:17 PM, borne52 <borne52@...> wrote:
         

        ploticus,

        Trying to make the world's simplest bar graph here, with this script:

        #proc getdata
        file: wine.dat
        showdata: yes
        delim: whitespace
        fieldnames: wine score

        #proc categories
        axis: x
        datafield: wine

        #proc areadef
        title: Wine Scores
        rectangle: 1 1 5 2
        //xrange: 0 30
        //yrange: 0 4

        xscaletype: categories

        // xautorange: datafield=wine
        yautorange: datafield=score
        yaxis.stubs: incremental 1

        xaxis.stubs: usecategories
        xaxis.stubvert: yes
         

        #proc bars

        locfield: wine
        lenfield: score

        // lenfield: 1
        //color: rgb(.8,1,.7)
        //longwayslabel: yes
        //labeldetails: align=R adjust=0,-0.1

        When I run it I see:

        1026 ~/tmp>pl -png winebars.pl
        // proc getdata has read & parsed these data:
        // field names are: wine|score|
        Wine:1|3|
        Wine:2|2|
        Wine:3|2|
        Wine:4|3|
        Wine:5|2|
        Wine:6|1|
        Wine:7|3|
        Wine:8|4|
        Wine:9|1|
        Wine:10|1|
        Wine:11|3|
        Wine:12|2|
        Wine:13|2|
        Wine:14|3|
        Wine:15|2|
        Wine:16|1|
        Wine:17|3|
        Wine:18|4|
        Wine:19|1|
        Wine:20|1|
        Wine:21|3|
        Wine:22|2|
        Wine:23|2|
        Wine:24|3|
        Wine:25|2|
        Wine:26|1|
        Wine:27|3|
        Wine:28|4|
        Wine:29|1|
        Wine:30|2|
        // end of data set
        pl proc areadef: error 5709: autorange: all data out of range

        And the resulting *png has a y axis with 1,2,3,4, no x axis and no bars. I've a few different variations - what am I missing?

        Thanks again,

        BIO


      Your message has been successfully submitted and would be delivered to recipients shortly.