[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnuplot-info
Subject:    Re: [Gnuplot-info] Coloring 2D data points - No palette
From:       Thomas Sefzick <t.sefzick () fz-juelich ! de>
Date:       2009-02-14 9:26:56
Message-ID: 22010723.post () talk ! nabble ! com
[Download RAW message or body]


cbrange is mapped to the gray intervall from 0.0 to 1.0,
so the color functions work in this range.
to get higher z-values, define cbrange:

zmin=1.5
zmax=6.5
# a mapping function needed to calculate the color
zval(x)=(x-zmin)/(zmax-zmin)
#
set cbrange [zmin:zmax]
# color functions
green(x)=x<=zval(2.5)?1.0:(x>zval(4.5)&&x<=zval(5.5)?1.0:0.0)
red(x)=x>zval(2.5)&&x<=zval(3.5)?1.0:(x>zval(4.5)?1.0:0.0)
blue(x)=x>zval(3.5)&&x<=zval(4.5)?1.0:(x>zval(5.5)?1.0:0.0)
#
set palette functions red(gray),green(gray),blue(gray)
test palette
# an example plot
splot [0:4] [0:4] x+y with pm3d


ranlot wrote:
> 
> Really helpful.  How would you modify this piece of code to include colors
> for z values higher than 1.  For example:
> z = 2  --> green
> z = 3  --> red
> z = 4  --> blue
> z = 5  --> something else
> z = 6   --> yet even another color.
> 
> 
> Thomas Sefzick wrote:
> > 
> > 
> > set palette functions 0,(gray>0.5?1.:0.),(gray<=0.5?1.:0.)
> > 
> > 
> 
> 

-- 
View this message in context: \
http://www.nabble.com/Coloring-2D-data-points---No-palette-interpolation-tp21958296p22010723.html
 Sent from the Gnuplot - User mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Gnuplot-info mailing list
Gnuplot-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnuplot-info


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic