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


Groups > comp.graphics.apps.gnuplot > #3858

Re: Variable fill color for polygons when using "filledcurves closed"

From Ethan Merritt <sfeam@users.sf.net>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Variable fill color for polygons when using "filledcurves closed"
Date 2018-01-10 18:10 +0000
Organization A noiseless patient Spider
Message-ID <p35ktv$g87$1@dont-email.me> (permalink)
References <7b902302-835d-46a6-bd9a-171afd215668@googlegroups.com> <p34hsd$c0d$1@solani.org> <p35fdr$go7$1@dont-email.me>

Show all headers | View raw


On Wed, 10 Jan 2018 08:36:11 -0800, Ethan A Merritt wrote:

> Karl Ratzsch wrote:
> 
>> Am 10.01.2018 um 04:43 schrieb Hua Tong:
>>> I want to plot polygons with filled color according to some variable
>>> defined, e.g., in third column. In short, the data format is as below:
>> 
>>> What I get is that the edge of each polygon is colored according to
>>> the third column, but not the filled color.
>> 
>> (gnuplot version? following is done with 5.2pl2)
>> 
>> Hm, the following fills the polygons with the demanded colour alright.
>> The last polygon breaks open if you remove the empty line behind it.
>> Looks like a separate bug to me.
>> 
>> ===========
>> $dat << EOD 1 1 10 1 2 10 2 2 10 2 1 10
>> 
>> 3 1 20 3 2 20 4 2 20 4 1 20
>> 
>> 1 3 40 1 4 40 2 4 40 2 3 40
>> 
>> EOD
>> 
>> #set yr [20:35]
>> #plot $dat u 1:2:3 w filledcurves closed fillcolor palette plot $dat u
>> 1:2:3 w filledcurves closed palette # does the same ============
>> 
>> If you uncomment the yr setting, the filling becomes monochrome,
>> however. Seems "palette" and "filledcurves" don't agree on how to use
>> the value in the third column.
>> 
>> All in all, also after trying to find it in the help, i think this is
>> not really supposed to work.
> 
> Indeed.
> As the program sees it, the desired operation is not well-defined. Data
> in the 3rd column?  What should I do with it? A color?
> But wait, what if the 3rd column number on the next line is different?
> How can a filled area have a color that changes at each vertex?

Have a look at the help text for "index", especially the example
plot command marked "very useful!"

In this case your data file would like something like:

#blue
x1 y1
x2 y2
x3 y3
x4 y4


#green
x1 y1
x2 y2
x3 y3


#purple 
x1 y1
x2 y2
...

and the plot command something like

colors = "blue green purple red"

plot for [color in colors] $DATA index color with filledcurve fc rgb color

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Find similar


Thread

Variable fill color for polygons when using "filledcurves closed" Hua Tong <tonghuagg@gmail.com> - 2018-01-09 19:43 -0800
  Re: Variable fill color for polygons when using "filledcurves closed" Karl Ratzsch <mail.kfr@gmx.net> - 2018-01-10 09:11 +0100
    Re: Variable fill color for polygons when using "filledcurves closed" Ethan A Merritt <EAMerritt@gmail.com> - 2018-01-10 08:36 -0800
      Re: Variable fill color for polygons when using "filledcurves closed" Ethan Merritt <sfeam@users.sf.net> - 2018-01-10 18:10 +0000

csiph-web