|
From: Thomas S. <t.s...@fz...> - 2009-10-29 14:43:14
|
in gnuplot 4.5-cvs (or the coming version 4.4) you
may use the following script:
reset
set xdata time
set timefmt "%Y-%m"
set format x "%m/%Y"
# dummy plot to collect the data set names (plots nothing)
laststring = ""
datasetnames = ""
set table
plot 'datafile' us 1:(stringcolumn(2) eq laststring \
? 0 \
: (laststring = stringcolumn(2) , \
datasetnames = datasetnames . " " . laststring , \
0))
unset table
# and now the real plot
plot for [i in datasetnames] 'datafile' \
using 1:(stringcolumn(2) eq i ? $4 : 0/0) \
title i with linespoints
Steve Cohen wrote:
>
> Given the following dataset
>
> 2009-04 OFF 67935 248967.45 0
> 2009-05 OFF 35693 131338.02 0
> 2009-06 OFF 118 599.07 0
> 2009-10 OFF 1 0.63 0
>
>
> 2009-04 NEW 1627 5566.72 1
> 2009-05 NEW 737 4996.18 1
> 2009-06 NEW 414 1902.48 1
> 2009-07 NEW 79 232.22 1
> 2009-08 NEW 119 248.03 1
> 2009-09 NEW 122 190.87 1
> 2009-10 NEW 97 67.92 1
>
>
> 2009-05 VERIFIED 1061 6909.02 10
> 2009-06 VERIFIED 3690 27681.30 10
> 2009-07 VERIFIED 1842 13867.37 10
> 2009-08 VERIFIED 1894 13529.98 10
> 2009-09 VERIFIED 1433 10401.02 10
> 2009-10 VERIFIED 1916 10619.17 10
>
>
> 2009-06 CERTIFIED 17 185.33 11
> 2009-07 CERTIFIED 163 1067.47 11
> 2009-08 CERTIFIED 127 1037.75 11
> 2009-09 CERTIFIED 118 1148.42 11
> 2009-10 CERTIFIED 532 2301.32 11
>
> I'd like to get the series titles from Column 2. Also, the double line
> feeds between series were added manually. It would be nice if I didn't
> have to do that and could trigger a new series based on the contents of
> column 2. Are either of these things possible.
>
> Since I can't do either of these I am doing instead
>
> set xdata time
> set timefmt "%Y-%m"
> set format x "%m/%Y"
> plot "datafile" index 0 u 1:4 t "OFF" with linespoints, \
> "" index 1 u 1:4 t "NEW" with linespoints, \
> "" index 2 u 1:4 t "VERIFIED" with linespoints,
> "" index 3 u 1:4 t "CERTIFIED" with linespoints
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Gnuplot-info mailing list
> Gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>
>
--
View this message in context: http://www.nabble.com/Series-labels-from-data-file--tp26102735p26114415.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|