kuki
kuki

Reputation: 433

Option to workaround "replot" in gnuplot

(1) I want to plot the following two functions. I know I can simply change the parameters for g(x) and use the command replot g(x) to plot both functions. But I am just wondering if there is any option to avoid "replot" command and use "something", so the parameters a and be wont be updated and both functions can be plotted?

f(x)=a*x**2+b*x
a=2
b=3
plot f(x)

<something>

g(x)=a*x**2+b*x
a=1
b=4
plot g(x)

(2) What if I do not know the parameter's values in advance during curve fitting in the following example?

 f(x)=a*x**2+b*x
 fit f(x) "filename" u 2 via a,b
 plot f(x)

    <something>

 g(x)=a*x**2+b*x
 fit g(x) "filename" u 2 via a,b
 plot g(x)

Thanks in advance!

Upvotes: 0

Views: 67

Answers (1)

mgilson
mgilson

Reputation: 309841

I'm not sure if this is what you meant, but:

f(x, a, b)=a*x**2 + b*x
plot f(x,2,3), f(x,1,4)

should do the trick ...

Upvotes: 1

Related Questions