|
From: Daniel J S. <dan...@ie...> - 2010-12-09 21:40:42
|
Alexandre Felipe wrote:
> Yes, I know that increase the number of samples and plot with dots may
> work. this could resolve the problem until the user zoom the chart.
> Whatever is the GNU tarball it appeared with the source code.
>
> /Finding discontinuities (or determining whether a function
> is continuous in a given interval) is quite hard for an arbitrary
> function./
> /How exactly do you intend to do this?/
>
> The user defined functions is not so arbitrary. and my analisis is for
> simple functions
> supose that i know f(x) and g(x)
>
> if(c = discontinuity of f){
> if((g(x1) < c) != (g(x2) < c)) {
> an treat it or only break the line betwen x1 and x2
> or find the closer x3 of the discontinuity and plot two points there
> one with the limit(f(x), x -> x3+) and other with limit(f(x), x -> x3-)
> i don't know how the gnuplot handles it internaly but it handles
>
> plot '-' with lines
> 1 2
> 2 2
>
> 2 1
> 2 1
> e
> }
> }else if(c = discontinuity of g betwen x1 and x2){
> plot the function in c with the two lateral limits
> }
>
>
> it's easy to implement it recursively less than 1000 lines i think :D
>
> discontinuities that i know
> 1/x - x = 0
> x < 0, x = 0
> gamma(x), x integer < 0
> floor(x), x integer
> it there are others is only specify
> so the returning value in each evaluation should carry information about
> the discontinuity only for the
> working interval,
If you know the limit points of your functions then there are ways to construct plots of multiple segments and achieve what you are looking for. Take a look at some of the examples in the demos:
http://gnuplot.sourceforge.net/demo_4.4
In particular, the statistical distributions have some good examples:
http://gnuplot.sourceforge.net/demo_4.4/prob.html
Check out the gamma function plot.
Dan
|