[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnuplot-info
Subject:    Q - how to create a certain style plot
From:       "Jeffrey Dykzeul" <Jeffrey_Dykzeul () raytheon ! com>
Date:       2002-05-10 18:12:30
[Download RAW message or body]

I am a novice gnuplot user, so bear with my ignorance.

I am using the UNIX sar utility to gather CPU utilization statistics
throughout the day. The final data file contains a record for each 1 minute
period of the day. Each record has the following five fields

     time      usr_CPU%    sys_CPU%    waitIO_CPU%    idle_CPU%

an actual sample of some records are

     09:10:00    27     9    6    58
     09:12:00    37    10    2    51
     09:13:00    31     6    0    63
     09:14:00    23     6    2    69
     09:15:00    20     5    1    74
     09:16:00    21     7    2    70

I have been able to generate plots which are almost what I want, but need
that last little tweak. The plots I am generating have time on the X axis
and CPU % on the Y axis. The data values show up as scattered points,
actually four different symbols somehow provided by gnuplot to represent
the four different categories of CPU usage. Each minute increment on the X
axis has 4 data points positioned vertically according to the numeric data
per category for that minute. For the actual sample shown above, the plot
looks roughly like

        100 +--------------
            |
            |
            |
         80 |
            |         i
            |           i
            |        i
         60 |      i
            |
            |       i
            |
         40 |
            |       u
            |        u
            |      u  u
         20 |          uu
            |
            |      ssssss
            |      ww www
          0 +--------w------

For the purposes of this message I have used u/s/w/i to represent the graph
points for the different categories. This graph format is OK, but what I
would really like is the following format

        100 +--------------
            |      iiiiii
            |      iiiiii
            |      iiiiii
         80 |      iiiiii
            |      iiiiii
            |      iiiiii
            |      iiiiii
         60 |      iiiiii
            |      iiiiii
            |      iwiiii
            |      isiiii
         40 |      wsiiii
            |      suswii
            |      suusww
            |      uuuuss
         20 |      uuuuuu
            |      uuuuuu
            |      uuuuuu
            |      uuuuuu
          0 +---------------

in which each category for a given period is shown as a vertical bar as
long as the actual numeric value for that category. The bar for the user %
would start at Y0 and go vertically to delta user, then the sys % would be
stacked on top of that, the waitIO % on top of that and the idle % on top
of that. Since they add up to 100% for each sample period, the whole graph
would be covered with representative symbols in four "layers" stacked on
top of each other. Of course they have different colors to help
differentiate.

Does anybody know how to accomplish this? There must be some geologists out
there who do something like this! I was thinking of using the "yerrorbar"
style, but I can't quite figure the syntax of the numeric values in the
plot command. There has to be some sort of inline calculation involved.


Jeff Dykzeul
Raytheon Electronic Systems

 - -
[[[[ to unsubscribe from info-gnuplot, send an email with body
unsubscribe info-gnuplot
to majordomo@dartmouth.edu
]]]]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic