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

possible use of non numbers on axis?

Expand Messages
  • bob884488
    First of all, I d like to express my appreciation for ploticus. It s very useful. I m using ploticus to render a couple of different plots for an evaluation of
    Message 1 of 2 , Apr 3, 2003
    • 0 Attachment
      First of all, I'd like to express my appreciation for ploticus. It's
      very useful.
      I'm using ploticus to render a couple of different plots for an
      evaluation of usability data.

      The input looks something like this
      03/31/2003.03:34:49,"Session1","1-Joe","Task-1","MenuSelection","Hit"
      03/31/2003.03:40:50,"Session1","1-Joe","Task-
      1","MenuSelection","Miss"
      03/31/2003.03:40:55,"Session1","1-Joe","Task-
      1","MenuSelection","Miss"

      One of the scripts I wrote today looks like this but unfortunately it
      will not work with the data set in the above format but slightly
      modified.

      -- cut --

      #proc getdata
      #if @PARTICIPANT = "0-AVERAGE"
      select: @@2 = @SESSION && @@5 = @TYPE
      #else
      select: @@2 = @SESSION && @@5 = @TYPE && @@3 = @PARTICIPANT
      #endif
      // we don't want to do sorting here but get rid of the date (we
      only use time)
      command cat @DATAFILE | awk -F. '{print $2}'
      fieldnames: time session participant task type value
      delim: comma
      showresults: yes

      // this sets the window size
      #proc page
      font: /Sans-Sarif
      textsize: 12
      #set CXMAS = $arith(@NRECORDS+1)
      #set CPX = $arith(@CXMAS+1)
      pagesize: @CPX 4
      #if @DEVICE = x11
      outlabel: Usability Study Visualization
      #endif
      croprel: 0.5 0.5 0.5 0.5

      // this sets the rendering window size
      #proc areadef
      title: @TYPE - @PARTICIPANT
      titledetails: style=R align=C adjust=0,0.3
      rectangle: 1 1 6 3
      xscaletype: time hh:mm:ss
      xautorange: datafield=time
      // yautorange: datafield=value lowfix=0 incmult=1.0
      yrange = 0 3

      // render x-axis
      #proc xaxis:
      tics: yes
      label: time
      labeldetails: adjust=0,-0.10
      // we assume that a usability study for a single person won't
      // span more than about 30 minutes
      stubs: inc 10 minutes
      minorticinc: 2 minutes
      stubformat: h:mm:ssa
      stubdetails: adjust=0,-0.10 size=7

      // render y-axis
      #proc yaxis
      // stubs datafields: value
      // tics: no
      stubs: inc 1

      // render actual plot
      #proc scatterplot
      xfield: time
      yfield: value
      symbol: shape=triangle radius=0.1 style=fillonly
      cluster: yes

      -- cut --

      This script works fine when the input looks like this:

      03/31/2003.03:34:49,"Session1","1-Joe","Task-1","MenuSelection",1
      03/31/2003.03:40:50,"Session1","1-Joe","Task-1","MenuSelection",0
      03/31/2003.03:40:55,"Session1","1-Joe","Task-1","MenuSelection",0

      I basically want to plot a graph were a scatter plot will appear at
      the appropriate times (field 1) and in the height according to the
      value (field 6). Unfortunately it seems like field 6 must be in a
      number format. Ideally ploticus would read the strings and see
      e.g. "Hit" and render these at location "0", next string is a "Miss"
      so the scatter plot is rendered at the next higher y-location 1. The
      third row has a "Hit" again so it's rendered at y = 0 just like the
      first one and so on.

      Is there anything I missed on how to do this? Otherwise I will
      probably have to revert to some ugly hacks where I will hardcode
      only 2 possible values for this type of script and sed the values to
      numbers within the ploticus script. In this particiular case this
      isn't too bad fortunately but I'm pretty sure I will run into
      similar issues in other scripts.



      On a similar note I wanted to do something like cummulative
      percentage on the next script. I have read in the news page that
      there have been plans for a procedure like that. Is there any beta
      yet I can test? :)
      I need the Y-axis to render percentages and the X-axis should render
      time values similar to the above script. But this time it should
      render the hit-ratio on the Y-axis. E.g when the first value is
      a "Hit" the first scatter plot will be at 100%, the next value is
      a "Miss" so the next scatter point is at 50% and so on.

      I guess the best way to do this is by doing a loop through all rows
      and do all the arithmetic on my own unless there is a procedure for
      this. I will try to figure this out after some sleep.

      Thank you for any pointers!
    • bob884488
      ... at ... a Miss ... Nevermind... Shortly after implementing the hack to get it to work without any flexbility I found the category setting while re-reading
      Message 2 of 2 , Apr 4, 2003
      • 0 Attachment
        --- In ploticus@yahoogroups.com, "bob884488" <bob884488@y...> wrote:
        > I basically want to plot a graph were a scatter plot will appear
        at
        > the appropriate times (field 1) and in the height according to the
        > value (field 6). Unfortunately it seems like field 6 must be in a
        > number format. Ideally ploticus would read the strings and see
        > e.g. "Hit" and render these at location "0", next string is
        a "Miss"
        > so the scatter plot is rendered at the next higher y-location 1.

        Nevermind...

        Shortly after implementing the hack to get it to work without any
        flexbility I found the category setting while re-reading some
        sections of the handbook.

        Using this I got exactly the results I have been looking for.
        Awesome!

        For those who are curious: I made the following changes to the script
        #proc areadef
        ycategories: datafield=value

        // render y-axis
        #proc yaxis
        tics: none
        stubs: usecategories

        Ok now I will try to figure out the cummulative percent one.
      Your message has been successfully submitted and would be delivered to recipients shortly.