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

List:       gnuplot-info
Subject:    Re: Help with assigning colors in gnuplot
From:       Amit Agrawal <agrawaa () ME ! UDel ! Edu>
Date:       1999-10-29 17:12:15
[Download RAW message or body]

Thanks a lot for your mails.
I finally found a way around it! What I do is according to the value 
in the color column break my file into 2 (or more pieces). Finally at
the time of plotting I plot all these files in the same frame. The 
package automatically assigns different colors to lines/arrows in these
files.

Regards,
Amit Agrawal

> >I am using GNUPLOT, Unix version 3.5, patchlevel 3.50.1.17, 27 Aug '93.
> >
> >I want to draw line/vectors in different colors. Is it possible to specify
> >a column with 0/1 (0= red, 1= blue) after the x,y columns so that at the
> >time of plotting the package assigns different colors depending on whether
> >the value in this column is 0 or 1?
> >
> >If this is possible, please let me know me how to do it. Your help will
> >be greatly appreciated.
> 
> 
> No, this is not possible.
> 
> There is a slightly messy workaround available with gnuplot 3.7, however, so
> you might consider updating.  With 3.7 you can do arithmetic on columns
> within the "using" string, so you could filter the data like this:
> 
>     plot 'file' using 1:($3==0?$2:0/0) with lines lt 1, '' u
> 1:($3==1?$2:0/0) w l lt 2
> 
> Basically this uses the ternary operator to decide whether to plot the value
> in column 2 or nothing (the undefined "0/0"), based on the value in column
> 3.
> 
> gnuplot 3.7 is available from gnuplot.vt.edu/pub/gnuplot (prefixed by ftp or
> by www ...).
> 
> Dick Crawford, aka crawford@arete.com
> 
> 


 - -
[[[[ to unsubscribe from info-gnuplot, send an email with body
unsubscribe info-gnuplot
to majordomo@dartmouth.edu
]]]]

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

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