« Return to Thread: Several horizontal lines

Re: Several horizontal lines

by Thomas Sefzick :: Rate this Message:

Reply to Author | View in Thread

simpler ways - 'outside' gnuplot, maybe, but 'inside', i don't think so,
because you read y-values in, which are then to be used as constant
functions after reading them in, that's somehow a 'misuse' of gnuplots
plotting mechanism.

'outside' gnuplot, e.g.:

load "< awk --field-separator \",\" 'BEGIN {temp = sprintf(\"plot\")} {if (NR>1) temp = temp \",\" ; temp = temp $2 \" title \" \"\\\"\" $1 \"\\\"\"} END{print temp}' ts.dat"

Daniel Clemente-2 wrote:
Thanks, this exactly parses the file. It will also be a good exercise to understand that.

  I supposed there would be a simpler way to do this in gnuplot. It is a common graph.

> you need gnuplot 4.3-cvs
>
> set datafile separator ","
> t=""
> plot for [i=0:4] 'ts.dat' us
> ((i==0&&$0==0)?(b=$2,t=stringcolumn(1)):99 ,
> $0==0?(a=b):99, $0==(i+1)?(b=$2,t=stringcolumn(1)):99 ,
> $0):(a) with lines
> title t
>
>



     

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Gnuplot-info mailing list
Gnuplot-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnuplot-info

 « Return to Thread: Several horizontal lines