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

Re: I can't manage to plot the graph with these data

Expand Messages
  • javaring
    THANK YOU STEVE!!! It works and looks good now. Thank you so much! Bee ... explained on ... necessary ... datetime field..
    Message 1 of 7 , Mar 27, 2002
    • 0 Attachment
      THANK YOU STEVE!!! It works and looks good now. Thank you so much!
      Bee

      --- In ploticus@y..., "Stephen C. Grubb" <scg@j...> wrote:
      > Bee,
      >
      > No problem.. you need to use datetime scaling in X. This is
      explained on
      > the "scale units" manual page. Datetimes are values of the form
      > DATE.TIME where the DATE can be any legal format.
      >
      > The script below should do what you requested. Note the datetime
      > specifications in areadef xscaletype and xrange. The filter is
      necessary
      > to deal with your date string, and arrange it into DATE.TIME notation.
      >
      > -Steve
      >
      >
      > #proc getdata
      > delim: comma
      > showresults: yes
      > command: cat bee2.dat | sed "s/%//g"
      >
      > // convert space-separated date(1) field to a mmm-dd-yyyy.hh:mm:ss
      datetime field..
      > filter:
      > ##set F2 = $change( " ", ",", @@2 )
      > ##if @@F2 != "Date"
      > ##set MON = $nmember( 2, @@F2 )
      > ##set DAY = $nmember( 3, @@F2 )
      > ##set YR = $nmember( 5, @@F2 )
      > ##set TIME = $nmember( 4, @@F2 )
      > ##set DATE = @MON "-" @DAY "-" @YR
      > ##else
      > ##set DATE = @@F2
      > ##endif
      > ##print @@1,@@DATE.@@TIME,@@3,@@4,@@5,@@6,@@7,@@8
      >
      > #proc areadef
      > rectangle: 1 1 6 4
      > yrange: 0 70
      > yaxis.stubs: inc
      >
      > // use datetime scaling in X..
      > xscaletype: datetime mmm-dd-yyyy.hh:mm:ss
      > xrange: Mar-21-2002.00:00:00 Mar-22-2002.12:00:00
      > xaxis.stubs: inc 6 hour
      > xaxis.stubformat: Mmmdd.hhA
      > xaxis.grid: color=gray(0.8) width=0.4
      >
      > // plot the fields
      > #for i in 3,4,5,6
      > #set COLOR = $icolor( @i )
      > #set LABEL = $dataitem( 1, @i )
      > #set LABEL = @LABEL "%"
      >
      > #proc lineplot
      > xfield: 2
      > yfield: @i
      > linedetails: color=@COLOR
      > legendlabel: @LABEL
      >
      > #endloop
      >
      > #proc legend
    Your message has been successfully submitted and would be delivered to recipients shortly.