|
From: Mahmood N. <nt_...@ya...> - 2014-09-10 06:20:14
|
Hello, I want to use "linecolor rgb variable". However, the final colors are all black! This is verified with the following commands set term wxt set term post eps enhanced color blacktext size 4,2.7 solid "Times-Roman" 12 I didn't find any option for variable colors while setting the terms. Regards, Mahmood |
|
From: Tait <gnu...@t4...> - 2014-09-10 07:01:57
|
"... linecolor" is an argument to the plot command, not the "set
terminal" command. Although the help files are not as clear as they
could be, you can see how it's used in the demos (e.g.
varcolor.dem) for additional hints. Specifically, "linecolor
variable" means the color of each point or portion of the line will
be determined by data from the user-provided file or input. If you
do not provide the additional data to color each segment, then it
probably defaults to black, which could explain your observation.
If you just want each line to be a different color, then that is
already the default behavior and you don't need to do anything
more. If you want to color each portion of each line differently,
then take a look at the demos to get you started, or something
simple like this may be illustrative enough:
unset key
set style data linespoints
# for r,g,b in range [0,1)
rgb(r,g,b)=int(r*2**24)|int(g*2**16)|(int(b)*2**8)
# make up something arbitrary...
colorfunc(x) = rgb((1+cos(x))*0.3, (1+sin(x-1))*0.15, (1+sin(x))*0.4)
plot '+' using 1:(sin($1)):(colorfunc($1)) \
linewidth 4 linecolor rgbcolor variable
Mahmood Naderan <nt_...@ya...> said (on 2014/09/10):
> Hello,
> I want to use "linecolor rgb variable". However, the final colors are all black!
> This is verified with the following commands
>
> set term wxt
> set term post eps enhanced color blacktext size 4,2.7 solid "Times-Roman" 12
>
> I didn't find any option for variable colors while setting the terms.
>
>
> Regards,
> Mahmood
|
|
From: Mahmood N. <nt_...@ya...> - 2014-09-10 09:28:22
|
OK I got it. One more question. What is the correct format for representing the color number? hex or dec?
I have a data file where the first column is the color number and the second column is the Y-axis.
When I write
400 10
800 20
Both points are black. Also when I write
0xAABBCC 10
0x0A0304 20
again both are black. I use the following command
plot 'test.dat' using 0:2:1 linecolor rgb variable pt 3
Regards,
Mahmood
On Wednesday, September 10, 2014 11:31 AM, Tait <gnu...@t4...> wrote:
"... linecolor" is an argument to the plot command, not the "set
terminal" command. Although the help files are not as clear as they
could be, you can see how it's used in the demos (e.g.
varcolor.dem) for additional hints. Specifically, "linecolor
variable" means the color of each point or portion of the line will
be determined by data from the user-provided file or input. If you
do not provide the additional data to color each segment, then it
probably defaults to black, which could explain your observation.
If you just want each line to be a different color, then that is
already the default behavior and you don't need to do anything
more. If you want to color each portion of each line differently,
then take a look at the demos to get you started, or something
simple like this may be illustrative enough:
unset key
set style data linespoints
# for r,g,b in range [0,1)
rgb(r,g,b)=int(r*2**24)|int(g*2**16)|(int(b)*2**8)
# make up something arbitrary...
colorfunc(x) = rgb((1+cos(x))*0.3, (1+sin(x-1))*0.15, (1+sin(x))*0.4)
plot '+' using 1:(sin($1)):(colorfunc($1)) \
linewidth 4 linecolor rgbcolor variable
Mahmood Naderan <nt_...@ya...> said (on 2014/09/10):
> Hello,
> I want to use "linecolor rgb variable". However, the final colors are all black!
> This is verified with the following commands
>
> set term wxt
> set term post eps enhanced color blacktext size 4,2.7 solid "Times-Roman" 12
>
> I didn't find any option for variable colors while setting the terms.
>
>
> Regards,
> Mahmood
|
|
From: Tait <gnu...@t4...> - 2014-09-10 20:42:13
|
As a string, it's hex: "... linecolor rgbcolor '#30a0f0'". As a bare number or linecolor variable, it's a packed tuple (or quad, when alpha-channel is involved) as an integer: 8 bits of red, 8 bits of green, then 8 bits of blue. Creating that number is what the rgb function does in the example I used. Whether you represent that integer in decimal, hexadecimal, or octal is of no matter to gnuplot. Pure blue would be 255 or 0xff; pure green 255 << 8, or 65280 or 0xff00; and pure red 255 << 16, or 16711680 or 0xff0000. A 50% gray would be 8421504 or 0x808080. Your 0xaabbcc... example below works for me. Note that with only two points, the default auto-range will put either point on the extreme of the graph, and one is gray and the other black, so it'd be easy to overlook that it's actually working. To make it more obvious, try more points/colors: unset key plot '-' using 0:2:1 linecolor rgb variable pointtype 5 pointsize 3 0xaabbcc 10 0xee0000 13 0x00aa00 16 0x222299 18 0x0a0304 20 e The 400 and 800 values as colors will both be dark blues, and perhaps mistakable for black if one doesn't look carefully. Mahmood Naderan <nt_...@ya...> said (on 2014/09/10): > OK I got it. One more question. What is the correct format for representing the color number? hex or dec? > I have a data file where the first column is the color number and the second column is the Y-axis. > > When I write > > 400 10 > 800 20 > > Both points are black. Also when I write > > 0xAABBCC 10 > 0x0A0304 20 > > again both are black. I use the following command > > plot 'test.dat' using 0:2:1 linecolor rgb variable pt 3 > > > > Regards, > Mahmood |
|
From: Mahmood N. <nt_...@ya...> - 2014-09-11 05:33:17
|
I tried with your example, but still all points are black. I will send a screenshot to you. Regards, Mahmood On Thursday, September 11, 2014 1:12 AM, Tait <gnu...@t4...> wrote: As a string, it's hex: "... linecolor rgbcolor '#30a0f0'". As a bare number or linecolor variable, it's a packed tuple (or quad, when alpha-channel is involved) as an integer: 8 bits of red, 8 bits of green, then 8 bits of blue. Creating that number is what the rgb function does in the example I used. Whether you represent that integer in decimal, hexadecimal, or octal is of no matter to gnuplot. Pure blue would be 255 or 0xff; pure green 255 << 8, or 65280 or 0xff00; and pure red 255 << 16, or 16711680 or 0xff0000. A 50% gray would be 8421504 or 0x808080. Your 0xaabbcc... example below works for me. Note that with only two points, the default auto-range will put either point on the extreme of the graph, and one is gray and the other black, so it'd be easy to overlook that it's actually working. To make it more obvious, try more points/colors: unset key plot '-' using 0:2:1 linecolor rgb variable pointtype 5 pointsize 3 0xaabbcc 10 0xee0000 13 0x00aa00 16 0x222299 18 0x0a0304 20 e The 400 and 800 values as colors will both be dark blues, and perhaps mistakable for black if one doesn't look carefully. |
|
From: Tait <gnu...@t4...> - 2014-09-11 12:34:52
|
You're using 4.6p3, and wxt on Windows. I tried the same configuration, and get different (normal) results. Is there perhaps something in your gnuplot.ini or wgnuplot.ini file(s) that's altering the normal startup default settings? Does something simple like even just "plot x" draw a black line, or a red line? Is the behavior different if you start the program as "wgnuplot.exe -d" instead of as just "wgnuplot.exe"? > I tried with your example, but still all points are black. > I will send a screenshot to you. > > Regards, > Mahmood > > > unset key > > plot '-' using 0:2:1 linecolor rgb variable pointtype 5 pointsize 3 > > 0xaabbcc 10 > > 0xee0000 13 > > 0x00aa00 16 > > 0x222299 18 > > 0x0a0304 20 > > e |
|
From: Mahmood N. <nt_...@ya...> - 2014-09-11 13:42:10
|
It seems that there is some thing wrong with interpreting hex numbers. Please see the attached shot. If I use decimal values, it is ok. But if I use 0xFFFFFF then the color is black!! Sorry if I shouldn't send attachments on the list. Regards, Mahmood On Thursday, September 11, 2014 5:04 PM, Tait <gnu...@t4...> wrote: You're using 4.6p3, and wxt on Windows. I tried the same configuration, and get different (normal) results. Is there perhaps something in your gnuplot.ini or wgnuplot.ini file(s) that's altering the normal startup default settings? Does something simple like even just "plot x" draw a black line, or a red line? Is the behavior different if you start the program as "wgnuplot.exe -d" instead of as just "wgnuplot.exe"? > I tried with your example, but still all points are black. > I will send a screenshot to you. > > Regards, > Mahmood > > > unset key > > plot '-' using 0:2:1 linecolor rgb variable pointtype 5 pointsize 3 > > 0xaabbcc 10 > > 0xee0000 13 > > 0x00aa00 16 > > 0x222299 18 > > 0x0a0304 20 > > e |
|
From: Dave H. <da...@ho...> - 2014-09-12 21:19:39
|
On Thu, 11 Sep 2014, Mahmood Naderan wrote: > It seems that there is some thing wrong with interpreting hex numbers. > Please see the attached shot. No attachments seemed to be attached... > If I use decimal values, it is ok. But if I use 0xFFFFFF then the color > is black!! What happens when you use e.g. 0xFF0000, 0x00FF00, 0x0000FF, and for laughs, 0x000000? And have you done something funny in your Gnuplot setup, like, inverting all colours or something?? > Sorry if I shouldn't send attachments on the list. It could be that the list strips them. -- Dave |
|
From: Mahmood N <nt_...@ya...> - 2014-09-13 05:18:46
|
>No attachments seemed to be attached... OK it seems that the list prevent me from sending attachments. I am CCing you so that you can see the screen shot. > And have you done something funny in your Gnuplot setup, like, inverting all colours or something?? No. I have just entered a default working directory in the "start in" field in the shortcut (on windows) Regards, Mahmood |