Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #2156

Re: graph from the string/numeric column.

Newsgroups comp.graphics.apps.gnuplot
Date 2013-10-16 21:42 -0700
References (9 earlier) <l38dj7$51u$1@news.rz.uni-karlsruhe.de> <48dde980-6bd1-40d9-99fe-2fd4b4863ee6@googlegroups.com> <l3gom1$qdp$1@news.rz.uni-karlsruhe.de> <14d3e4f7-0da5-4220-a283-16b466fcb253@googlegroups.com> <l3mgl1$674$1@news.rz.uni-karlsruhe.de>
Message-ID <b8af0481-4409-4bfc-a06c-99bd3c5fd306@googlegroups.com> (permalink)
Subject Re: graph from the string/numeric column.
From thesunshine99@gmail.com

Show all headers | View raw


On Wednesday, October 16, 2013 11:59:10 AM UTC-5, Karl wrote:
> Am 14.10.2013 19:07, schrieb thesunshine99@gmail.com:
> 
> > On Monday, October 14, 2013 7:39:25 AM UTC-5, Karl wrote:
> 
> >> Am 11.10.2013 17:12, schrieb thesunshine99@gmail.com:
> 
> >>
> 
> >>> cat /tmp/_pp
> 
> >>
> 
> >>> server1 35000 105 09-26-13
> 
> >>
> 
> >>> server1 35000 105 09-27-13
> 
> >>
> 
> >>> server1 35000 280 09-28-13
> 
> >>
> 
> >>> server1 35000 280 10-01-13
> 
> >>
> 
> >>> server1 35000 280 10-02-13
> 
> >>
> 
> >>> server1 35000 420 10-05-13
> 
> >>
> 
> >>> server1 35000 420 10-06-13
> 
> >>
> 
> >>>
> 
> >>
> 
> >>> server2 49000 0 09-26-13
> 
> >>
> 
> >>> server2 49000 0 09-27-13
> 
> >>
> 
> >>> server2 49000 0 09-28-13
> 
> >>
> 
> >>> server2 49000 0 09-29-13
> 
> >>
> 
> >>> server2 49000 0 09-30-13
> 
> >>
> 
> >>> server2 49000 0 10-01-13
> 
> >>
> 
> >>> server2 49000 0 10-02-13
> 
> >>
> 
> >>>
> 
> >>
> 
> >>>
> 
> >>
> 
> >>>
> 
> >>
> 
> >>>
> 
> >>
> 
> >>> for server_name in `awk ' { print $1 }' /tmp/_pp | sort | uniq| sed '/^$/d'`
> 
> >>
> 
> >>> do
> 
> >>
> 
> >>> cat << EOF | /usr/local/bin/gnuplot
> 
> >>
> 
> >>
> 
> >>
> 
> >> Just print two empty lines between each block, and you can address each
> 
> >>
> 
> >> with "index". Then you can give an individual linecolour to each server,
> 
> >>
> 
> >> etc.
> 
> >>
> 
> >>
> 
> >>
> 
> >>
> 
> >>
> 
> >> plot 	"" index 1 using 4:3 with lc 1, \
> 
> >>
> 
> >> 	"" index 2 using 4:3 with lc 2, \
> 
> >>
> 
> >> 	...	
> 
> >>
> 
> >>
> 
> >>
> 
> >> or
> 
> >>
> 
> >>
> 
> >>
> 
> >> plot for [i=1:4] "" using 4:3 index i with lc i
> 
> >>
> 
> >>
> 
> >>
> 
> >>
> 
> >>
> 
> >> P.S. Can you switch your emailer to pure text mode for newsgroups? It
> 
> >>
> 
> >> looks very ugly otherwise.
> 
> > 
> 
> > I apologize the mail text mode. I am just replying from the existing mail. Not sure where to change it.
> 
> > 
> 
> > With this set of data which has two blank lines between the block.
> 
> > 
> 
> > server1 35000 105 09-26-13
> 
> > server1 35000 105 09-27-13
> 
> > server1 35000 280 09-28-13
> 
> > server1 35000 280 09-29-13
> 
> > server1 35000 280 09-30-13
> 
> > 
> 
> > 
> 
> > server2 49000 0 09-26-13
> 
> > server2 49000 0 09-27-13
> 
> > server2 49000 0 09-28-13
> 
> > server2 49000 0 09-29-13
> 
> > server2 49000 0 09-30-13
> 
> > 
> 
> > And the code is
> 
> > 
> 
> > emptylines=`grep "^$" /tmp/_pp| wc -l`
> 
> > emptylines=`expr $emptylines / 2`
> 
> > 
> 
> > for server_name in `awk ' { print $1 }' /tmp/_pp | sort | uniq| sed '/^$/d'`
> 
> > do
> 
> > cat << EOF | /usr/local/bin/gnuplot
> 
> >         set terminal postscript eps enhanced color
> 
> >         set output  "/tmp/abc.ps"
> 
> >         set autoscale
> 
> >         set grid
> 
> >         set title "Usage"
> 
> >         set xlabel "Server Name"
> 
> >         set ylabel "GB"
> 
> >         set yr [0:$maxsize]
> 
> > 		set xr [-1:]
> 
> >         set xtics nomirror rotate by -90 font ",16"
> 
> > 		set xdata time
> 
> >         set timefmt "%m-%d-%y"
> 
> >         set format x "%m/%d"
> 
> > 		plot for [i=1:$emptylines] '/tmp/_pp' index i using 4:3 with lines lc i  title '$server_name'
> 
> > EOF
> 
> > done
> 
> > 
> 
> > i still have no charm to fix it.
> 
> > 
> 
> 
> 
> I�ve copied your example dataset to "test.txt" and did
> 
> 
> 
> set yrange [-10:] # just that the points at zero are visible
> 
> set xdata time
> 
> set timefmt "%m-%d-%y"
> 
> set format x "%m/%d"
> 
> 
> 
> plot for [i=0:1] 'test.txt' index i using 4:3 \
> 
> 		with lines lc i  title sprintf("%.f",i)
> 
> 
> 
> 
> 
> an i get a graph "0" from 105 up to 280, and a graph "1" at zero, over
> 
> september dates.
> 
> 
> 
> Note that the first dataset has index zero, not one. I do not understand
> 
> your maxsize and emptylines variables, and why do you set xrange [-1:] ?
> 
> 
> 
>   Karl

Thx Karl. I have appreciate all your help. the maxsize is mazsize from the col2 to be use for the y-axis. The emptlines is for count the number of two blank lines between the blocks and divide by two.

Server1
Server1 35000 105 09-26-13
Server1 35000 105 09-27-13
Server1 35000 280 09-28-13
Server1 35000 280 09-29-13
Server1 35000 280 09-30-13
Server1 35000 280 10-01-13
Server1 35000 280 10-02-13
Server1 35000 280 10-03-13
Server1 35000 280 10-04-13
 
 
Server2
Server2 49000 0 09-26-13
Server2 49000 0 09-27-13
Server2 49000 0 09-28-13
Server2 49000 0 09-29-13
Server2 49000 0 09-30-13
Server2 49000 0 10-01-13
Server2 49000 0 10-02-13
Server2 49000 0 10-03-13
Server2 49000 0 10-04-13
 
 
Server3
Server3 49000 1372 09-26-13
Server3 49000 1372 09-27-13
Server3 49000 1372 09-28-13
Server3 49000 1372 09-29-13
Server3 49000 1372 09-30-13
Server3 49000 1372 10-01-13
Server3 49000 1372 10-02-13
Server3 49000 1372 10-03-13
Server3 49000 1372 10-04-13
 
 
Server4
Server4 49000 0 09-26-13
Server4 49000 0 09-27-13
Server4 49000 0 09-28-13
Server4 49000 0 09-29-13
Server4 49000 0 09-30-13
Server4 49000 0 10-01-13
Server4 49000 0 10-02-13
Server4 49000 0 10-03-13
Server4 49000 0 10-04-13

maxsize=`awk ' { print $2 }' /tmp/_pp| sort -n | uniq| tail -1`


emptylines=`grep "^ " /tmp/_pp| wc -l`
emptylines=`expr $emptylines / 2`

cat << EOF | /usr/local/bin/gnuplot
        set terminal postscript eps enhanced color
        set output  "/tmp/pp.ps"
        set autoscale
        set grid
        set title "TSM Usage"
        set xlabel " Name"
        set ylabel "GB"
        set yr [0:$maxsize]
		set key outside;
	    set xtics nomirror rotate by -90 font ",16"
		set xdata time
        set timefmt "%m-%d-%y"
        set format x "%m-%d-%y"
plot for [i=0:$emptylines] '/tmp/_pp' index i using 4:3 with lines lc i lt 1 lw 2 title columnheader(1) 
EOF

The lines color is repeating after few server. I am not sure why each server is not getting its own color. I have atleast 14+ server in the list.

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

graph from the string/numeric column. thesunshine99@gmail.com - 2013-10-08 13:42 -0700
  Re: graph from the string/numeric column. Karl <mail.kfr@gmx.net> - 2013-10-09 10:24 +0200
    Re: graph from the string/numeric column. thesunshine99@gmail.com - 2013-10-09 07:27 -0700
      Re: graph from the string/numeric column. thesunshine99@gmail.com - 2013-10-09 08:25 -0700
        Re: graph from the string/numeric column. thesunshine99@gmail.com - 2013-10-09 09:26 -0700
          Re: graph from the string/numeric column. Karl <mail.kfr@gmx.net> - 2013-10-10 09:37 +0200
            Re: graph from the string/numeric column. thesunshine99@gmail.com - 2013-10-10 12:41 -0700
              Re: graph from the string/numeric column. thesunshine99@gmail.com - 2013-10-10 13:33 -0700
                Re: graph from the string/numeric column. thesunshine99@gmail.com - 2013-10-10 13:53 -0700
                Re: graph from the string/numeric column. Karl <mail.kfr@gmx.net> - 2013-10-11 10:41 +0200
                Re: graph from the string/numeric column. thesunshine99@gmail.com - 2013-10-11 08:12 -0700
                Re: graph from the string/numeric column. thesunshine99@gmail.com - 2013-10-11 13:22 -0700
                Re: graph from the string/numeric column. Karl <mail.kfr@gmx.net> - 2013-10-14 14:39 +0200
                Re: graph from the string/numeric column. thesunshine99@gmail.com - 2013-10-14 10:07 -0700
                Re: graph from the string/numeric column. Karl <mail.kfr@gmx.net> - 2013-10-16 18:59 +0200
                Re: graph from the string/numeric column. thesunshine99@gmail.com - 2013-10-16 21:42 -0700
                Re: graph from the string/numeric column. Karl <ratzsch@polymer.uka.de> - 2013-10-20 09:48 +0200
                Re: graph from the string/numeric column. sfeam <sfeam@users.sourceforge.net> - 2013-10-20 12:08 -0700
                Re: graph from the string/numeric column. thesunshine99@gmail.com - 2013-10-21 11:02 -0700

csiph-web