Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #2019
| From | sfeam <sfeam@users.sourceforge.net> |
|---|---|
| Newsgroups | comp.graphics.apps.gnuplot |
| Subject | Re: histogram bar colors |
| Date | 2013-09-03 12:40 -0700 |
| Organization | gnuplot development team |
| Message-ID | <l05e00$185$2@dont-email.me> (permalink) |
| References | <d7c91259-2e16-470f-83fe-2cdce8ac1e0f@googlegroups.com> <l00jki$ba1$1@dont-email.me> <167f9dc7-6782-47f9-bf5f-c3f17e1d85c5@googlegroups.com> |
bryan wrote:
> On Sunday, September 1, 2013 7:46:22 PM UTC-4, sfeam wrote:
>> It will be easier to show "with boxes".
>>
>> Add the following lines to your script:
>>
>> barcolor(n) = strstrt(strcol(n), "0") ? 2 : 3
>>
>> set boxwidth 0.2 absolute
>>
>> and replace the plot command with
>>
>> plot 'test_01sep13a.dat' u 0:3:(barcolor(1)):xticlabel(1) \
>>
>> with boxes fillcolor variable notitle
>>
>> The key point here is to specify "fillcolor variable",
>
> thats interesting, and precisely what I was looking for - thanks a lot.
> also seems to be a good reason to get the latest patchlevel.
Oops, I had forgotten that some versions had a bug in recognizing
the "fillcolor variable" keyword. Here is a slight variation that
should work also on older gnuplot versions starting from 4.4.
barcolor(n) = strstrt(strcol(n), "0") ? 0xff0000 : 0x0000ff
plot 'test_01sep13a.dat' u 0:3:(barcolor(1)):xticlabel(1) \
with boxes notitle lt rgb variable
The two colors in question are specified as 24-bit RGB colors
in hexadecimal form, pure red and pure blue in this case.
Ethan
Back to comp.graphics.apps.gnuplot | Previous | Next — Previous in thread | Find similar | Unroll thread
histogram bar colors bryan <bryanlepore@gmail.com> - 2013-09-01 11:22 -0700
Re: histogram bar colors sfeam <sfeam@users.sourceforge.net> - 2013-09-01 16:46 -0700
Re: histogram bar colors bryan <bryanlepore@gmail.com> - 2013-09-01 19:31 -0700
Re: histogram bar colors sfeam <sfeam@users.sourceforge.net> - 2013-09-03 12:40 -0700
csiph-web