View previous topic :: View next topic |
Author |
Message |
lord_nimula n00b
Joined: 04 Jun 2004 Posts: 31
|
Posted: Sun Nov 28, 2004 3:30 am Post subject: GNUPlot question |
|
|
I have a collection of data points to which I fit a function, f(x). I have no problem plotting both the points and f(x) over the domain that I am interested in, but there is one more thing to do: I must evaluate f(x) for a particular x (no problem) and then plot that point. How? How do I plot exactly one point that results from a series of calculations, rather than read in from a data file?
--Lord Nimula
PS: The report I am working on is due Monday. _________________ --Lord Nimula |
|
Back to top |
|
|
xianx Tux's lil' helper
Joined: 09 Aug 2003 Posts: 126 Location: Canada
|
Posted: Sun Nov 28, 2004 4:35 am Post subject: |
|
|
Have you tried:
where the x is the point you're looking for.. _________________ if at first you dont succeed, Skydiving is not for you.
#make love not war! |
|
Back to top |
|
|
lord_nimula n00b
Joined: 04 Jun 2004 Posts: 31
|
Posted: Sun Nov 28, 2004 6:17 am Post subject: |
|
|
Actually, gnuplot comlains about the xrange being empty when it comes time to plot.
After a bit of mucking about, though, I did hit upon a solution:
Code: |
set print "tmp.dat"
x_half = -log(.5) / u
I_half = f(x_half)
print x_half, I_half
plot f(x) with lines, "pb.dat" with points pointtype 1, "tmp.dat" with points pointtype 3 pointsize 2
|
Basically, output the point to a temporary file and then plot it as normal. It works well enough, but is there a better way.
--Lord Nimula _________________ --Lord Nimula |
|
Back to top |
|
|
|