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


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

replotting curves for different values of coefficients

Started byDan Connelly <djconnel@gmail.com>
First post2016-11-04 15:22 -0700
Last post2016-11-05 01:55 +0100
Articles 2 — 2 participants

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


Contents

  replotting curves for different values of coefficients Dan Connelly <djconnel@gmail.com> - 2016-11-04 15:22 -0700
    Re: replotting curves for different values of coefficients Karl Ratzsch <mail.kfr@gmx.net> - 2016-11-05 01:55 +0100

#3437 — replotting curves for different values of coefficients

FromDan Connelly <djconnel@gmail.com>
Date2016-11-04 15:22 -0700
Subjectreplotting curves for different values of coefficients
Message-ID<7f66318a-a67a-4ac3-95a5-b273176196e2@googlegroups.com>
I'm trying to superpose curves for different values of a coefficient.

For example, consider:

a = 1
plot a * x
a = 2
replot a*x
a = 3
replot a*x

This doesn't accomplish what I want, which is to superpose these curves.  This is because a is evaluated at plot time, rather than at the time the plot command is executed.

Any ideas?

This, on the other hand, does work, but isn't what I want to do, since my actual formulas are more complicated:

a = 1
plot a * x
b = 2
replot b*x
c = 3
replot c*x


thanks!

[toc] | [next] | [standalone]


#3439

FromKarl Ratzsch <mail.kfr@gmx.net>
Date2016-11-05 01:55 +0100
Message-ID<nvjamk$g2i$1@solani.org>
In reply to#3437
Am 04.11.2016 um 23:22 schrieb Dan Connelly:
> I'm trying to superpose curves for different values of a coefficient.
> 

plot for [a=0:5] f(x,a)

plot for [a in "1.3 1.4 1.6 1.9. 2.4"] exp(-(x-a)**2)


in gnuplot >5.1, there are also (respectivley will most likely be in
the next stable release) array variables:

plot for [i=0:5] a[i]*x**2 + b[i]*x + c[i]

[toc] | [prev] | [standalone]


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


csiph-web