X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 88.191.16.109 Path: csiph.com!eeepc.pasdenom.info!news.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!nospam.fr.eu.org!usenet-fr.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Olaf Schultz Newsgroups: comp.graphics.apps.gnuplot Subject: Re: change line color when plot crosses Y value Date: 28 Jan 2011 15:53:15 GMT Lines: 36 Message-ID: <8qg73bFjd1U2@mid.individual.net> References: <15c8f4bc-fd7b-4486-972d-9321f6c96c62@m27g2000prj.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net f1o7eDFFhd6G9rxs75nY4A3JNbXnxm7sQAMJT370YTiUTeIejZ Cancel-Lock: sha1:Yutb/bUs8KlSpcOx6Kia/k9oZ2w= User-Agent: Pan/0.132 (Waxed in Black) Xref: csiph.com comp.graphics.apps.gnuplot:2088 On Fri, 28 Jan 2011 06:41:28 -0800, ginginsman wrote: > I know I have seen this somewhere but cannot find it: I'd like to find a > way to change the color of a plot line when it crosses a specified value > of Y; blue above, red below, for example. > > with data like this: > > 2011/02/01-03:31 0.59 > 2011/02/01-09:48 9.93 > 2011/02/01-16:11 -0.34 > 2011/02/01-22:24 8.88 > 2011/02/02-04:18 0.44 > 2011/02/02-10:32 9.96 > 2011/02/02-16:53 -0.36 > > set xdata time > 
 set timefmt x  "%Y/%m/%d-%H:%M" > 
 set samples 1000 > 
 plot 'data.txt' u 1:2 sm cspl > > Find a way to change the curve color at any value > or < 1 (for > example). maybe the hard way: ycr=0.1 plot "data.txt u 1:($2>ycr?$2:1/0) lt 1 ,"" u 1:($2<=ycr?$2:1/0) lt 2 t "" > OSX 10.6.6 > GNUplot Version 4.4 patchlevel 2