Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #1992 > unrolled thread
| Started by | Dieter Britz <dieterhansbritz@gmail.com> |
|---|---|
| First post | 2013-08-22 14:24 +0000 |
| Last post | 2013-08-23 15:04 +0200 |
| Articles | 7 — 3 participants |
Back to article view | Back to comp.graphics.apps.gnuplot
Using using Dieter Britz <dieterhansbritz@gmail.com> - 2013-08-22 14:24 +0000
Re: Using using Karl <mail.kfr@gmx.net> - 2013-08-22 17:46 +0200
Re: Using using Dieter Britz <dieterhansbritz@gmail.com> - 2013-08-23 08:50 +0000
Re: Using using Christoph Bersch <usenet@bersch.net> - 2013-08-23 11:40 +0200
Re: Using using Dieter Britz <dieterhansbritz@gmail.com> - 2013-08-23 12:02 +0000
Re: Using using Dieter Britz <dieterhansbritz@gmail.com> - 2013-08-23 12:44 +0000
Re: Using using Christoph Bersch <usenet@bersch.net> - 2013-08-23 15:04 +0200
| From | Dieter Britz <dieterhansbritz@gmail.com> |
|---|---|
| Date | 2013-08-22 14:24 +0000 |
| Subject | Using using |
| Message-ID | <kv56va$q32$1@dont-email.me> |
I want to plot column 2 against col. 1, but subtract a constant from col. 2. I tried, in a test script, plot 'test.dat' using 1:($2 + 1) w p pt 7 but gnuplot complains Warning: empty y range [1:1], adjusting to [0.99:1.01] although the data file contains 1 1 2 2 3 3 4 4 5 5 What am I doing wrong? I read this in the manual: plot 'file' using 1:($2+$3) "%1f,%1f,%1f" which led me to use the above. I assume the format stuff is not needed. If I am doing this wrong, how do I modify a given column to be plotted arithmetically? -- Dieter Britz
[toc] | [next] | [standalone]
| From | Karl <mail.kfr@gmx.net> |
|---|---|
| Date | 2013-08-22 17:46 +0200 |
| Message-ID | <kv5boi$q05$1@news.rz.uni-karlsruhe.de> |
| In reply to | #1992 |
Am 22.08.2013 16:24, schrieb Dieter Britz: > I want to plot column 2 against col. 1, but subtract > a constant from col. 2. I tried, in a test script, > > plot 'test.dat' using 1:($2 + 1) w p pt 7 > > but gnuplot complains > > Warning: empty y range [1:1], adjusting to [0.99:1.01] > > although the data file contains > > 1 1 > 2 2 > 3 3 > 4 4 > 5 5 > You´ve set an xrange that ends between one and two.
[toc] | [prev] | [next] | [standalone]
| From | Dieter Britz <dieterhansbritz@gmail.com> |
|---|---|
| Date | 2013-08-23 08:50 +0000 |
| Message-ID | <kv77pa$loj$1@dont-email.me> |
| In reply to | #1993 |
On Thu, 22 Aug 2013 17:46:37 +0200, Karl wrote: > Am 22.08.2013 16:24, schrieb Dieter Britz: >> I want to plot column 2 against col. 1, but subtract a constant from >> col. 2. I tried, in a test script, >> >> plot 'test.dat' using 1:($2 + 1) w p pt 7 >> >> but gnuplot complains >> >> Warning: empty y range [1:1], adjusting to [0.99:1.01] >> >> although the data file contains >> >> 1 1 2 2 3 3 4 4 5 5 >> >> > You´ve set an xrange that ends between one and two. No I didn't - I think. Here is the whole script: gnuplot << eoi set term postscript enh eps 24 set output 'test.eps' plot 'test.dat' using 1:($2 + 1) w p pt 7 quit eoi What should I be writing if I want the number 1 added to all the values in column 2? The data file is OK; if I make that using 1:2 it plots alright. -- Dieter Britz
[toc] | [prev] | [next] | [standalone]
| From | Christoph Bersch <usenet@bersch.net> |
|---|---|
| Date | 2013-08-23 11:40 +0200 |
| Message-ID | <kv7aml$3nt$1@dont-email.me> |
| In reply to | #1995 |
Am 23.08.2013 10:50, schrieb Dieter Britz: > > gnuplot<< eoi > set term postscript enh eps 24 > set output 'test.eps' > plot 'test.dat' using 1:($2 + 1) w p pt 7 > quit > eoi If you call gnuplot from a shell you should use column(2).
[toc] | [prev] | [next] | [standalone]
| From | Dieter Britz <dieterhansbritz@gmail.com> |
|---|---|
| Date | 2013-08-23 12:02 +0000 |
| Message-ID | <kv7ivs$8tk$1@dont-email.me> |
| In reply to | #1997 |
On Fri, 23 Aug 2013 11:40:37 +0200, Christoph Bersch wrote: > Am 23.08.2013 10:50, schrieb Dieter Britz: >> >> gnuplot<< eoi set term postscript enh eps 24 set output 'test.eps' >> plot 'test.dat' using 1:($2 + 1) w p pt 7 quit eoi > > If you call gnuplot from a shell you should use column(2). ?? I have been using this, e.g. "using 1:3" to override the default 1:2, for years, and never a problem. Or do you mean I must use that if I want to manipulate the values in a column? If so, exactly how do I express that? The manual for 4.6 shows it as I use it - and I get an error. -- Dieter Britz
[toc] | [prev] | [next] | [standalone]
| From | Dieter Britz <dieterhansbritz@gmail.com> |
|---|---|
| Date | 2013-08-23 12:44 +0000 |
| Message-ID | <kv7lg7$m1a$1@dont-email.me> |
| In reply to | #1998 |
On Fri, 23 Aug 2013 12:02:04 +0000, Dieter Britz wrote: > On Fri, 23 Aug 2013 11:40:37 +0200, Christoph Bersch wrote: > >> Am 23.08.2013 10:50, schrieb Dieter Britz: >>> >>> gnuplot<< eoi set term postscript enh eps 24 set output 'test.eps' >>> plot 'test.dat' using 1:($2 + 1) w p pt 7 quit eoi >> >> If you call gnuplot from a shell you should use column(2). > > ?? I have been using this, e.g. "using 1:3" to override the default 1:2, > for years, and never a problem. Or do you mean I must use that if I want > to manipulate the values in a column? > If so, exactly how do I express that? The manual for 4.6 shows it as I > use it - and I get an error. PS: I worked it out, and it works - thanks! -- Dieter Britz
[toc] | [prev] | [next] | [standalone]
| From | Christoph Bersch <usenet@bersch.net> |
|---|---|
| Date | 2013-08-23 15:04 +0200 |
| Message-ID | <kv7mkj$s27$1@dont-email.me> |
| In reply to | #1998 |
Am 23.08.2013 14:02, schrieb Dieter Britz: > On Fri, 23 Aug 2013 11:40:37 +0200, Christoph Bersch wrote: > >> If you call gnuplot from a shell you should use column(2). > > ?? I have been using this, e.g. "using 1:3" to override the > default 1:2, for years, and never a problem. Or do you mean > I must use that if I want to manipulate the values in a column? Ok, I wasn't very specific: If you want to manipulate the values in a column, you can use either column(3) or its shorthand $3. However, if you invoke gnuplot from a shell using heredocs (<<eoi), like in your example, the $3 is interpreted as a shell variable. You could of course escape the dollar sign, but IMHO the best way is to use column(3) in that case which makes you independent of the environment. Christoph
[toc] | [prev] | [standalone]
Back to top | Article view | comp.graphics.apps.gnuplot
csiph-web