Andrey V. Komolkin
2007-03-17 18:40:34 UTC
Dear colleagues,
I am frequent user and enthusiast of "gnuplot", but not a developer. Let
me propose some new features for the program. I hope these are new,
because I did not find any references to such features in documentation
for new version 4.3.
---------------
First. In the "plot" command I propose to allow to setup range of 'x'
(independent) variable to each of functions/files. For instance:
set xrange [0:10]
plot sin(x), cos(x) range [1:9], 'file.dat' range [1:9] with lines
In this example, sin(x) should be shown in range [0:10], but cos(x) and
data from 'file.dat' in different ranges, which are set individually for
these graphs. This may be useful in the case we like to plot tabulated
data and its approximation (analytical function) in the same plot.
Imagine, the data we like to approximate have two parts:
f1(x)=a*x+b
fit [0:5] f1(x) 'file.dat' via a,b
f2(x)=c*x+d
fit [6:10] f2(x) 'file.dat' via c,d
set xr [0:10]
plot 'file.dat' w p, [0:5] f1(x), [6:10] f2(x)
I do not like to plot analytical function f1(x) outside the range [0:5],
where it was fitted and (in general) defined. And vice versa, f2(x) was
defined in range [6:10]...
-----------------
Second. Let me propose "dashed" ranges: [0:10,20:30]. This feature may be
useful for approximation of experimental data.
Imagine, experimental data g(x) contains several peaks f(x) on the
"basement" -0.02*x+1.0. We need to remove trend (-0.02*x+1.0) from the
data.
set xr [-10:10]
set yr [0:7]
f(x,a,x0,dx)=a*exp(-(x-x0)**2/dx**2)
g(x)=f(x,5,1,1)+f(x,2,-3,0.5)+1.0-0.02*x
This trend can not be determined on the whole range [-10:10],
but on two ends of the range:
t(x)=a*x+b
fit [*:-5,5:*] t(x) 'file.dat' via a,b
set xr [-10:10]
plot t(x) range [-10:-5,5:10], 'file.dat' with points
------------------
Conclusion. I proposed in this letter two new features for the 'gnuplot'.
First: separate ranges for each functions/files in 'plot' command
Second: "dashed" ("united" or however it will be called) ranges which
consist of several (two, three or even more) subranges.
------------------
I like to receive comments on my proposals.
Best wishes,
Andrei Komolkin.
======================================================================
Dr. Andrei V. Komolkin
Senior Lecturer (University Reader)
V. A. Fock Institute of Physics Tel.: +7-(812)-428-44-79
Saint-Petersburg State University Fax: +7-(812)-428-72-40
198504, Saint-Petersburg E-mail: ***@esr.phys.spbu.ru
Russia
I am frequent user and enthusiast of "gnuplot", but not a developer. Let
me propose some new features for the program. I hope these are new,
because I did not find any references to such features in documentation
for new version 4.3.
---------------
First. In the "plot" command I propose to allow to setup range of 'x'
(independent) variable to each of functions/files. For instance:
set xrange [0:10]
plot sin(x), cos(x) range [1:9], 'file.dat' range [1:9] with lines
In this example, sin(x) should be shown in range [0:10], but cos(x) and
data from 'file.dat' in different ranges, which are set individually for
these graphs. This may be useful in the case we like to plot tabulated
data and its approximation (analytical function) in the same plot.
Imagine, the data we like to approximate have two parts:
f1(x)=a*x+b
fit [0:5] f1(x) 'file.dat' via a,b
f2(x)=c*x+d
fit [6:10] f2(x) 'file.dat' via c,d
set xr [0:10]
plot 'file.dat' w p, [0:5] f1(x), [6:10] f2(x)
I do not like to plot analytical function f1(x) outside the range [0:5],
where it was fitted and (in general) defined. And vice versa, f2(x) was
defined in range [6:10]...
-----------------
Second. Let me propose "dashed" ranges: [0:10,20:30]. This feature may be
useful for approximation of experimental data.
Imagine, experimental data g(x) contains several peaks f(x) on the
"basement" -0.02*x+1.0. We need to remove trend (-0.02*x+1.0) from the
data.
set xr [-10:10]
set yr [0:7]
f(x,a,x0,dx)=a*exp(-(x-x0)**2/dx**2)
g(x)=f(x,5,1,1)+f(x,2,-3,0.5)+1.0-0.02*x
This trend can not be determined on the whole range [-10:10],
but on two ends of the range:
t(x)=a*x+b
fit [*:-5,5:*] t(x) 'file.dat' via a,b
set xr [-10:10]
plot t(x) range [-10:-5,5:10], 'file.dat' with points
------------------
Conclusion. I proposed in this letter two new features for the 'gnuplot'.
First: separate ranges for each functions/files in 'plot' command
Second: "dashed" ("united" or however it will be called) ranges which
consist of several (two, three or even more) subranges.
------------------
I like to receive comments on my proposals.
Best wishes,
Andrei Komolkin.
======================================================================
Dr. Andrei V. Komolkin
Senior Lecturer (University Reader)
V. A. Fock Institute of Physics Tel.: +7-(812)-428-44-79
Saint-Petersburg State University Fax: +7-(812)-428-72-40
198504, Saint-Petersburg E-mail: ***@esr.phys.spbu.ru
Russia