Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?Q?J=c3=b6rg_Buchholz?= Newsgroups: comp.graphics.apps.gnuplot Subject: Re: Overlaying two histograms Date: Wed, 27 Jan 2016 18:44:07 +0100 Organization: A noiseless patient Spider Lines: 101 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Date: Wed, 27 Jan 2016 17:41:19 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="3abaad00a617e85f20ad80a51764357e"; logging-data="15238"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+K0X17CmmToe8XU4RJNo9WcChPG6zUceE=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39 In-Reply-To: Cancel-Lock: sha1:2kAxrQ2rswcoQNNUgXlD3i9qk4U= Xref: csiph.com comp.graphics.apps.gnuplot:3182 On 27.01.2016 14:13, Janis Papanagnou wrote: > This is probably not that easy to answer; I'll try to explain my proble= m. > > In case that the ASCII-art below is not displayed appropriately I've ad= ded > two links to the respective *.png files in the signature for clarificat= ion. > > I have currently two histogram data; the first are plain boxes like thi= s: > > | _ | > | _ | | | > | | | | | _ | > | | | | | | | | > +-----+-----+-----+ ... + > AAA BBB CCC > > and I use code like this to create it: > > set boxwidth 0.67 relative > set style fill solid 1.0 > ... > plot 'data-1' using 2:xticlabels(1) title '' with boxes lt 0 > > This is exactly what I want for the first visible layer (at the bottom)= =2E > Now I want to put data with a more detailled resulution on top. Each of= > the boxes above will be overlayed by a couple thin boxes. To create the= > respective second histogram layer I use code like this to create it: > > set style data histograms > ... > set boxwidth 0.67 relative > set style fill solid 1.0 > ... > plot 'data-2' using 3:xtic(1) ti col, '' using 5 ti col, \ > '' using 6 ti col, '' using 4 ti col, '' using 7 ti col > > This is not exactly what I want; as opposed to the first layer above th= e > respective clusters of the histogram are grouped around the '+' tic-mar= ks, > like this: > > | | | > | || | | | > | || | | || | > | ||| ||| ||| | > +-----+-----+-----+ ... + > AAA BBB CCC > > What I need to overlay the first histogram with the second one would be= > something like this instead: > > | | | > | || | | | > | || | | || | > | ||| ||| ||| | > +-----+-----+-----+ ... + > AAA BBB CCC > > but it seems that the definition of "set style data histograms" results= in > that formatting, grouped around the tic-marks. Can this default be chan= ged? > > The question is; how can I specify such clustered histogram data to be > aligned appropriately? - A solution to this question is the preconditio= n to > overlay the two data representations so that the respective boxes and t= he > x-tic labels match. > If I understand your problem correctly this small example may can help=20 you. But it is more "handcraftet" with boxes than use the histograms. File jp.dat: xtics x data dd1 dd2 dd3 AAA 1 7 6 8 3 BBB 2 6 5 4 9 CCC 3 8 6 7 9 gnuplot-script: set boxwidth 0.8 set style fill solid 1.0 set xrange [0:4] set yrange [0:10] plot 'jp.dat' u 2:3:xtic(1) with boxes title columnheader,\ '' u ($2-0.3):4:(0.2) with boxes title columnheader,\ '' u 2:5:(0.2) with boxes title columnheader,\ '' u ($2+0.3):6:(0.2) with boxes title columnheader J=F6rg