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


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

Scaling one data file

Started byDieter Britz <dieterhansbritz@gmail.com>
First post2012-11-05 13:12 +0000
Last post2012-11-06 22:10 +0100
Articles 4 — 3 participants

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


Contents

  Scaling one data file Dieter Britz <dieterhansbritz@gmail.com> - 2012-11-05 13:12 +0000
    Re: Scaling one data file Karl <ratzsch@polymer.uka.de> - 2012-11-05 18:47 +0100
      Re: Scaling one data file Dieter Britz <dieterhansbritz@gmail.com> - 2012-11-06 12:33 +0000
        Re: Scaling one data file Ingo Thies <ingo.thies@gmx.de> - 2012-11-06 22:10 +0100

#1467 — Scaling one data file

FromDieter Britz <dieterhansbritz@gmail.com>
Date2012-11-05 13:12 +0000
SubjectScaling one data file
Message-ID<k78e0a$adq$1@dont-email.me>
I plot two curves, where the one always lies in the y range
[0:1] but the other varies, and sometimes has a much smaller
y-range. I plot them with

plot 'datafile' w l, 'datafile' using 1:3 w l

and in some cases, the 1:3 plot hugs the zero line.
Can I multiply it by some factor in the plot statement?

I know I can do that in the program that writes out the
data but I would also like to do it within gnuplot.

-- 
Dieter Britz

[toc] | [next] | [standalone]


#1468

FromKarl <ratzsch@polymer.uka.de>
Date2012-11-05 18:47 +0100
Message-ID<k78u3v$80q$1@news.rz.uni-karlsruhe.de>
In reply to#1467
You can of course

plot "" using 1:(sin($3)**2)

(rtfm ;-) but have you tried plotting your secod dataset on x1y2?

plot "" us 1:2 , "" using 1:3 axes x1y2


Karl


On 05.11.2012 14:12, Dieter Britz wrote:
> I plot two curves, where the one always lies in the y range
> [0:1] but the other varies, and sometimes has a much smaller
> y-range. I plot them with
> 
> plot 'datafile' w l, 'datafile' using 1:3 w l
> 
> and in some cases, the 1:3 plot hugs the zero line.
> Can I multiply it by some factor in the plot statement?
> 
> I know I can do that in the program that writes out the
> data but I would also like to do it within gnuplot.
> 

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


#1470

FromDieter Britz <dieterhansbritz@gmail.com>
Date2012-11-06 12:33 +0000
Message-ID<k7b028$r5t$1@dont-email.me>
In reply to#1468
On Mon, 05 Nov 2012 18:47:43 +0100, Karl wrote:

> You can of course
> 
> plot "" using 1:(sin($3)**2)
> 
> (rtfm ;-) but have you tried plotting your secod dataset on x1y2?
> 
> plot "" us 1:2 , "" using 1:3 axes x1y2


> On 05.11.2012 14:12, Dieter Britz wrote:
>> I plot two curves, where the one always lies in the y range [0:1] but
>> the other varies, and sometimes has a much smaller y-range. I plot them
>> with
>> 
>> plot 'datafile' w l, 'datafile' using 1:3 w l
>> 
>> and in some cases, the 1:3 plot hugs the zero line.
>> Can I multiply it by some factor in the plot statement?


Why sin($3)**2? I saw that in the manual but don't understand it.
As I wrote, I want to multiply that column by 1000, not take the
sine function. WOuld that therefore be
... using 1:(1000*($3)) 
or what? Thaqt doesn't seem to work.

-- 
Dieter Britz

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


#1472

FromIngo Thies <ingo.thies@gmx.de>
Date2012-11-06 22:10 +0100
Message-ID<aftcl9F5ssoU1@mid.individual.net>
In reply to#1470
Am 2012-11-06 13:33, schrieb Dieter Britz:

> Why sin($3)**2? I saw that in the manual but don't understand it.
> As I wrote, I want to multiply that column by 1000, not take the
> sine function. WOuld that therefore be
> ... using 1:(1000*($3))
> or what? Thaqt doesn't seem to work.

It should work, but maybe a factor of 1000 is simply too large. Try 10, 
100 etc. first. BTW, your modifyer command can be simplified by removing 
the inner pair of parentheses, i.e.

...using 1:(1000*$3).

However, in your case I would also suggest to rescale the yrange, so the 
labelled values remain correct.

HTH,

Ingo

[toc] | [prev] | [standalone]


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


csiph-web