Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  nodelist  faq  login

Though I'll admit readability suffers slightly... -- Larry Wall in <2969@jato.Jpl.Nasa.Gov>


computers / comp.graphics.apps.gnuplot / linecolor and fillcolor as stringvariable

SubjectAuthor
* linecolor and fillcolor as stringvariableJörg_Buchholz
`* Re: linecolor and fillcolor as stringvariableJörg_Buchholz
 `- Re: linecolor and fillcolor as stringvariableEthan Merritt

1
Subject: linecolor and fillcolor as stringvariable
From: Jörg_Buchholz
Newsgroups: comp.graphics.apps.gnuplot
Organization: A noiseless patient Spider
Date: Tue, 3 Sep 2019 12:03 UTC
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: bookwood...@freenet.de (Jörg_Buchholz)
Newsgroups: comp.graphics.apps.gnuplot
Subject: linecolor and fillcolor as stringvariable
Date: Tue, 3 Sep 2019 14:03:41 +0200
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <qklkqu$r5p$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 3 Sep 2019 12:03:42 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="a715b7968ec4d934128585f9ef9e8222";
logging-data="27833"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18vQaLxoQOkotrhar8S03CC59YcgG3t7io="
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101
Thunderbird/60.8.0
Cancel-Lock: sha1:NkQameHZ8XxlcHg9vojhriS+DRw=
Content-Language: en-US
X-Mozilla-News-Host: news://news.eternal-september.org:119
View all headers
Hello,

for me string variables being hard. I can't found a way to set "lc" and
"fc" as string variables.

example:

color1 = "red"
color2 = "green"
set obj 1 rect from 0,0 to 5,5 fc color1
set obj 2 rect from 0,0 to 5,-5 fc color2
plot sin(x) w l lc color1, cos(x) w l lc color2

How must I define the variables?



set obj 1 rect from 0,0 to 5,5 fc 'red'
set obj 2 rect from 0,0 to 5,-5 fc 'green'
plot sin(x) w l lc 'red', cos(x) w l lc 'green'

This works, but there are much lines and much rectangles. So it will be
easier to change the color if I can define them as variables.



Thanks for any help,

Jörg


Subject: Re: linecolor and fillcolor as stringvariable
From: Jörg_Buchholz
Newsgroups: comp.graphics.apps.gnuplot
Organization: A noiseless patient Spider
Date: Tue, 3 Sep 2019 12:38 UTC
References: 1
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: bookwood...@freenet.de (Jörg_Buchholz)
Newsgroups: comp.graphics.apps.gnuplot
Subject: Re: linecolor and fillcolor as stringvariable
Date: Tue, 3 Sep 2019 14:38:58 +0200
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <qklmt3$7ic$1@dont-email.me>
References: <qklkqu$r5p$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 3 Sep 2019 12:38:59 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="a715b7968ec4d934128585f9ef9e8222";
logging-data="7756"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/wDKrbP6ga4eLwnRP84aTPUrAEybC1iTc="
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101
Thunderbird/60.8.0
Cancel-Lock: sha1:aURf4BkU3jcdd9EiIscFuBnMo44=
In-Reply-To: <qklkqu$r5p$1@dont-email.me>
Content-Language: en-GB
View all headers
On 03.09.2019 14:03, Jörg Buchholz wrote:
Hello,

for me string variables being hard. I can't found a way to set "lc" and
"fc" as string variables.

example:

color1 = "red"
color2 = "green"
set obj 1 rect from 0,0 to 5,5 fc color1
set obj 2 rect from 0,0 to 5,-5 fc color2
plot sin(x) w l lc color1, cos(x) w l lc color2

How must I define the variables?


OK. I found a way.

color1 = "'red'"
color2 = "'green'"
set obj 1 rect from 0,0 to 5,5 fc @color1
set obj 2 rect from 0,0 to 5,-5 fc @color2
plot sin(x) w l lc @color1, cos(x) w l lc @color2


Jörg


Subject: Re: linecolor and fillcolor as stringvariable
From: Ethan Merritt
Newsgroups: comp.graphics.apps.gnuplot
Organization: A noiseless patient Spider
Date: Fri, 13 Sep 2019 19:36 UTC
References: 1 2
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: eamerr...@gmail.com (Ethan Merritt)
Newsgroups: comp.graphics.apps.gnuplot
Subject: Re: linecolor and fillcolor as stringvariable
Date: Fri, 13 Sep 2019 19:36:07 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <qlgr37$jpe$1@dont-email.me>
References: <qklkqu$r5p$1@dont-email.me> <qklmt3$7ic$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 13 Sep 2019 19:36:07 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4f5e84765e902ced634ebf566be7848d";
logging-data="20270"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18hAKw+PQ7V0oImSHFs4N1D"
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:A72KPqfxEPa3CQy8uQX2vG3/O8M=
View all headers
On Tue, 03 Sep 2019 14:38:58 +0200, Jörg Buchholz wrote:

On 03.09.2019 14:03, Jörg Buchholz wrote:
Hello,

for me string variables being hard. I can't found a way to set "lc" and
"fc" as string variables.

example:

color1 = "red"
color2 = "green"
set obj 1 rect from 0,0 to 5,5 fc color1
set obj 2 rect from 0,0 to 5,-5 fc color2
plot sin(x) w l lc color1, cos(x) w l lc color2

How must I define the variables?


OK. I found a way.

color1 = "'red'"
color2 = "'green'"
set obj 1 rect from 0,0 to 5,5 fc @color1
set obj 2 rect from 0,0 to 5,-5 fc @color2
plot sin(x) w l lc @color1, cos(x) w l lc @color2


Jörg

Gnuplot is confused because it is expecting a linetype number
in the commands you show.  Adding the keyword "rgb" will cause
it to expect a string containing a color name, a hexadecimal
representation of the color in the form "#RRGGBB", or various
other forms explained by 'help colorspec'.

Example:

   color1 = "red"
   color2 = "green"
   plot sin(x) w l lc rgb color1, cos(x) w l lc rgb color2

Ethan


1
rocksolid light 0.7.2
clearneti2ptor