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


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

Re: Plot with boxes and rgb variable

From Ingo Thies <ingo.thies@gmx.de>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Plot with boxes and rgb variable
Date 2012-11-15 11:43 +0100
Message-ID <agjv9sF863tU1@mid.individual.net> (permalink)
References <agii45FterrU1@mid.individual.net> <k81q0b$e1s$1@dont-email.me>

Show all headers | View raw


Sorry, since a while, Thunderbird (16.0.1, Ubuntu) labels "reply to
group" as "followup", and "reply" is e-mail only. Since then, I
repeatedly reply as mail rather than to the group. The TB developers
should really improve the intuitive handling of their GUI.

On 15.11.2012 05:10, sfeam wrote:

> That would work if the file contained hexadecimal numbers in standard
> C format:   0xFF0000  0x00FF00  0x0000FF.
> The '#' character makes it a string rather than a number.

My mistake was to assume that the string format is automatically
recognized by gnuplot as an RGB specifier. Is far as I could find in the
manual, there is no hint that standard C format has to be used here, and
this format has been replaced by the string format in terminal settings
some versions ago.

Meanwhile, I have modified the program that outputs the data so that it
now writes RGB triples rather than hexadecimals, so it works now.

> OK, so we have to convert the string to a number:
> 
>   # replace the leading '#' with '0x' and convert to integer
>   RGB(s) = int( "0x" . s[2:*] )
>   plot 'data' using 1:2:(RGB(strcol(3))) w boxes lc rgbcolor variable

Thanky, this might be useful for later. However, I am happy now with RGB
integer triples :-)

Best wishes,

Ingo

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


Thread

Plot with boxes and rgb variable Ingo Thies <ingo.thies@gmx.de> - 2012-11-14 22:52 +0100
  Re: Plot with boxes and rgb variable sfeam <sfeam@users.sourceforge.net> - 2012-11-14 20:10 -0800
    Re: Plot with boxes and rgb variable Ingo Thies <ingo.thies@gmx.de> - 2012-11-15 11:43 +0100

csiph-web