Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #3325 > unrolled thread
| Started by | Dieter Britz <dieterhansbritz@gmail.com> |
|---|---|
| First post | 2016-05-23 08:36 +0000 |
| Last post | 2016-05-25 11:16 +0000 |
| Articles | 6 — 3 participants |
Back to article view | Back to comp.graphics.apps.gnuplot
histograms Dieter Britz <dieterhansbritz@gmail.com> - 2016-05-23 08:36 +0000
Re: histograms Karl Ratzsch <mail.kfr@gmx.net> - 2016-05-23 11:10 +0200
Re: histograms Dieter Britz <dieterhansbritz@gmail.com> - 2016-05-23 12:28 +0000
Re: histograms Karl Ratzsch <mail.kfr@gmx.net> - 2016-05-23 17:36 +0200
Re: histograms Jörg Buchholz <bookwood4news@freenet.de> - 2016-05-23 18:48 +0200
Re: histograms Dieter Britz <dieterhansbritz@gmail.com> - 2016-05-25 11:16 +0000
| From | Dieter Britz <dieterhansbritz@gmail.com> |
|---|---|
| Date | 2016-05-23 08:36 +0000 |
| Subject | histograms |
| Message-ID | <nhufef$24h$1@dont-email.me> |
I have a data file with two sets, that I want to make a histogram
plot of (it's called 0.dat).
1 3.2521
2 6.2901
3 11.7867
4 32.9382
I looked up histograms in the manual and got this far in
the script:
set boxwidth 0.9 relative
set style data histograms
set style histogram cluster
plot for (COL=2) '0.dat' using COL
I get an error on the COL part. How should I do this?
It seems to me that the histogram style is different from
that for lines or points, where I would use, e.g.
plot '0.dat' using (1:2) w p pt 6
--
Dieter Britz
[toc] | [next] | [standalone]
| From | Karl Ratzsch <mail.kfr@gmx.net> |
|---|---|
| Date | 2016-05-23 11:10 +0200 |
| Message-ID | <nhuhei$mlu$1@solani.org> |
| In reply to | #3325 |
Am 23.05.2016 um 10:36 schrieb Dieter Britz: > plot for (COL=2) '0.dat' using COL What is this supposed to do? Why the "for" iterator? Btw., the syntax is "plot for [COL=a:b]", with square brackets. > It seems to me that the histogram style is different from > that for lines or points, where I would use, e.g. > > plot '0.dat' using (1:2) w p pt 6 "using (1:2)" ?!? Yes, "histogram" style expects only one column of data, as the abscissa is implicitly defined. The values have to equidistant and be fed sequentially. Have you read "help histograms"?
[toc] | [prev] | [next] | [standalone]
| From | Dieter Britz <dieterhansbritz@gmail.com> |
|---|---|
| Date | 2016-05-23 12:28 +0000 |
| Message-ID | <nhut0h$ii4$1@dont-email.me> |
| In reply to | #3326 |
On Mon, 23 May 2016 11:10:34 +0200, Karl Ratzsch wrote: > Am 23.05.2016 um 10:36 schrieb Dieter Britz: >> plot for (COL=2) '0.dat' using COL > > What is this supposed to do? Why the "for" iterator? > > Btw., the syntax is "plot for [COL=a:b]", with square brackets. > >> It seems to me that the histogram style is different from that for >> lines or points, where I would use, e.g. >> >> plot '0.dat' using (1:2) w p pt 6 > > "using (1:2)" ?!? > > Yes, "histogram" style expects only one column of data, as the abscissa > is implicitly defined. The values have to equidistant and be fed > sequentially. Have you read "help histograms"? Yes, but it's a bit cryptic to me. I have now got a histogram, with your help, using this: set boxwidth 0.9 relative set style data histograms set style histogram cluster plot for [COL=1:2] '0.dat' using COL #, '1.dat' using COL and having eliminated the count column. Now I want two of them, one using 0.dat (the previous first set) as is, open bars, plus the second set 1.dat, alongside that with filled bars. How do I do that? -- Dieter Britz
[toc] | [prev] | [next] | [standalone]
| From | Karl Ratzsch <mail.kfr@gmx.net> |
|---|---|
| Date | 2016-05-23 17:36 +0200 |
| Message-ID | <nhv82j$e9h$1@solani.org> |
| In reply to | #3327 |
Am 23.05.2016 um 14:28 schrieb Dieter Britz: > Yes, but it's a bit cryptic to me. I have now got a histogram, > with your help, using this: > > set boxwidth 0.9 relative > set style data histograms > set style histogram cluster > plot for [COL=1:2] '0.dat' using COL #, '1.dat' using COL > > and having eliminated the count column. > Now I want two of them, one using 0.dat (the previous first set) > as is, open bars, plus the second set 1.dat, alongside that with > filled bars. How do I do that? Still i do not see what you want the "for" iteration for. Have you read "help plot for"? I thought your first column only contains the sequential numbers of the histogram slots (which gnuplot does not need anyway, but surely they are not histogram data)? Anyway, your "set" commands plus plot "0.dat" us col 2, "1.dat" using col 2 does it. What is the problem?
[toc] | [prev] | [next] | [standalone]
| From | Jörg Buchholz <bookwood4news@freenet.de> |
|---|---|
| Date | 2016-05-23 18:48 +0200 |
| Message-ID | <nhvc1c$cp9$1@dont-email.me> |
| In reply to | #3325 |
On 23.05.2016 10:36, Dieter Britz wrote: > I have a data file with two sets, that I want to make a histogram > plot of (it's called 0.dat). > > 1 3.2521 > 2 6.2901 > 3 11.7867 > 4 32.9382 > > I looked up histograms in the manual and got this far in > the script: > > set boxwidth 0.9 relative > set style data histograms > set style histogram cluster > plot for (COL=2) '0.dat' using COL > > I get an error on the COL part. How should I do this? If you only want to plot the second (only one col) use the follwing: set style histogram rowstacked plot '0.dat' u 2 or use "with boxes" plot '0.dat' u 1:2 w boxes Jörg
[toc] | [prev] | [next] | [standalone]
| From | Dieter Britz <dieterhansbritz@gmail.com> |
|---|---|
| Date | 2016-05-25 11:16 +0000 |
| Message-ID | <ni41j2$ig3$1@dont-email.me> |
| In reply to | #3329 |
On Mon, 23 May 2016 18:48:05 +0200, Jörg Buchholz wrote: > On 23.05.2016 10:36, Dieter Britz wrote: >> I have a data file with two sets, that I want to make a histogram plot >> of (it's called 0.dat). >> >> 1 3.2521 2 6.2901 3 11.7867 4 32.9382 >> >> I looked up histograms in the manual and got this far in the script: >> >> set boxwidth 0.9 relative set style data histograms set style >> histogram cluster plot for (COL=2) '0.dat' using COL >> >> I get an error on the COL part. How should I do this? > > If you only want to plot the second (only one col) use the follwing: > > set style histogram rowstacked plot '0.dat' u 2 > > or use "with boxes" > > plot '0.dat' u 1:2 w boxes > > Jörg That did the trick, thanks! I didn't know about boxes. -- Dieter Britz
[toc] | [prev] | [standalone]
Back to top | Article view | comp.graphics.apps.gnuplot
csiph-web