Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #2019
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | sfeam <sfeam@users.sourceforge.net> |
| Newsgroups | comp.graphics.apps.gnuplot |
| Subject | Re: histogram bar colors |
| Date | Tue, 03 Sep 2013 12:40:48 -0700 |
| Organization | gnuplot development team |
| Lines | 35 |
| 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> |
| Reply-To | sfeam@users.sourceforge.net |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="ISO-8859-1" |
| Content-Transfer-Encoding | 7Bit |
| Injection-Date | Tue, 3 Sep 2013 19:40:48 +0000 (UTC) |
| Injection-Info | mx05.eternal-september.org; posting-host="8e86a57dfa599721f116da4577f3d1af"; logging-data="1285"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Nz0DfJEdHmupuLam3DtbD" |
| User-Agent | KNode/4.10.5 |
| Cancel-Lock | sha1:D624JQbYpoyaiBv6zEpQZMttHf4= |
| Xref | csiph.com comp.graphics.apps.gnuplot:2019 |
Show key headers only | View raw
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