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


Groups > comp.graphics.apps.gnuplot > #2088 > unrolled thread

Re: change line color when plot crosses Y value

Started byOlaf Schultz <o.newsa@enhydralutris.de>
First post2011-01-28 15:53 +0000
Last post2011-01-28 15:53 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.graphics.apps.gnuplot

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: change line color when plot crosses Y value Olaf Schultz <o.newsa@enhydralutris.de> - 2011-01-28 15:53 +0000

#2088 — Re: change line color when plot crosses Y value

FromOlaf Schultz <o.newsa@enhydralutris.de>
Date2011-01-28 15:53 +0000
SubjectRe: change line color when plot crosses Y value
Message-ID<8qg73bFjd1U2@mid.individual.net>
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

[toc] | [standalone]


Back to top | Article view | comp.graphics.apps.gnuplot


csiph-web