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


Groups > comp.graphics.apps.gnuplot > #3938 > unrolled thread

How to define bar area colors in a histogram

Started byBengt T <bengt_tornqvist@hotmail.com>
First post2018-04-08 08:49 -0700
Last post2018-04-10 04:29 -0700
Articles 3 — 2 participants

Back to article view | Back to comp.graphics.apps.gnuplot


Contents

  How to define bar area colors in a histogram Bengt T <bengt_tornqvist@hotmail.com> - 2018-04-08 08:49 -0700
    Re: How to define bar area colors in a histogram Jörg Buchholz <bookwood4new@freenet.de> - 2018-04-10 08:48 +0200
      Re: How to define bar area colors in a histogram Bengt T <bengt_tornqvist@hotmail.com> - 2018-04-10 04:29 -0700

#3938 — How to define bar area colors in a histogram

FromBengt T <bengt_tornqvist@hotmail.com>
Date2018-04-08 08:49 -0700
SubjectHow to define bar area colors in a histogram
Message-ID<a645efe0-905a-41a5-8c13-17948769b07d@googlegroups.com>
I use the following input to gnuplot:

#*****
clear
reset

set key left top verical

set xtics rotate
set ytics rotate
set ytics 0, 200
set y2tics rotate
set y2tics 0, 200

set grid

set style data histogram
set style fill solid border
set style histogram rowstacked
set boxwidth 0.5 relative

set terminal jpeg font "Droid Sans Mono"
set output "tmp.jpg"

plot for [COL=2:4] 'testdata.txt' using COL:xticlabels(1) title columnheader
#*****

for the following data (testdata.txt):

#****
Date    Key_1   Key_2   Key_3
2017-01-31      50      50      50
2017-02-28      75      50      150
2017-03-31      25      100     200
2017-04-30      150     200     250
2017-05-31      200     50      100
#****

In my PC this results in bars with red, green and blue areas.

I kindly ask for advises on how to define other colors? 

[toc] | [next] | [standalone]


#3939

FromJörg Buchholz <bookwood4new@freenet.de>
Date2018-04-10 08:48 +0200
Message-ID<pahmn6$1ak$1@dont-email.me>
In reply to#3938
On 08.04.2018 17:49, Bengt T wrote:
> I use the following input to gnuplot:
> 
> #*****
> clear
> reset
> 
> set key left top verical
> 
> set xtics rotate
> set ytics rotate
> set ytics 0, 200
> set y2tics rotate
> set y2tics 0, 200
> 
> set grid
> 
> set style data histogram
> set style fill solid border
> set style histogram rowstacked
> set boxwidth 0.5 relative
> 
> set terminal jpeg font "Droid Sans Mono"
> set output "tmp.jpg"
> 
> plot for [COL=2:4] 'testdata.txt' using COL:xticlabels(1) title columnheader
> #*****
> 
> for the following data (testdata.txt):
> 
> #****
> Date    Key_1   Key_2   Key_3
> 2017-01-31      50      50      50
> 2017-02-28      75      50      150
> 2017-03-31      25      100     200
> 2017-04-30      150     200     250
> 2017-05-31      200     50      100
> #****
> 
> In my PC this results in bars with red, green and blue areas.
> 
> I kindly ask for advises on how to define other colors? 
> 

You can predefine the colors by setting the color of the linetype.

As example

set linetype 1 lc rgb 'green'
set linetype 2 lc rgb 'yellow'
set linetype 3 lc rgb 'goldenrod'

gives the three columns in green, yellow and goldenrod to you.

Jörg

[toc] | [prev] | [next] | [standalone]


#3941

FromBengt T <bengt_tornqvist@hotmail.com>
Date2018-04-10 04:29 -0700
Message-ID<b51174a6-abbb-4f96-b817-43b19c4ae5b9@googlegroups.com>
In reply to#3939
> 
> You can predefine the colors by setting the color of the linetype.
> 
> As example
> 
> set linetype 1 lc rgb 'green'
> set linetype 2 lc rgb 'yellow'
> set linetype 3 lc rgb 'goldenrod'
> 
> gives the three columns in green, yellow and goldenrod to you.
> 
> Jörg

Many thanks. Problem solved.
/Bengt

[toc] | [prev] | [standalone]


Back to top | Article view | comp.graphics.apps.gnuplot


csiph-web