People who code: we want your input. Take the Survey

# Tag Info

## Hot answers tagged gnuplot

5

You could either fit a logistic function (possibly composing it with a linear function), use segmented regression, or classification and regression trees, among other options. The original data, shown in the figure below, was fitted in Gnuplot using the following commands: h(x) = k * 0.5 * (1.0 - tanh(0.5 * (a * x + b))) + c * x + d fit h(x) 'plot-EV.txt' ...

3

An assortment of curves for fitting chemistry examples is presented in these Colby College class notes. Of particular application is the sigmoid response curve with variable "slope" for the central part of the curve: $$f(x) = \frac{a}{1 + e^{bx - c} } + d$$ [This is similar to the suggested logistic function proposed in the first Answer, but has four ...

2

I think a piecewise function is a perfect case for using a closure. This frees you from the need of having a cumbersome n as an argument. import numpy as np import matplotlib.pyplot as plt def define_fn(n): def fn(x): if n <= x <= n + 1: return float(x) - n elif n + 1 <= x <= n + 2: return 2.0 - x + ...

2

You must put a dot in all the numbers which are supposed to be floats, so as to be correct while doing division. In gnuplot 2/3 = 0 but 2.0/3.0 = 0.66666..7 In your example, you are suffering from division by zero, but gnuplot does not give good error message. Here is corrected version which runs without any error B0P = 4.0; B0 = 30.0 V0 = 36.0; E0 = -535.0; ...

2

According with this blog the way to find max e min with gnuplot is: With Gnuplot 4.6 the both the x and y coordinate of maximum and minimum points can be find out easily. The method is using new command "stats". This command is used for statistic. When it is run, some statistical results will be gotten. If your data file contains two column of data, (...

1

Thanks to Thor, I figured out the solutions to my questions. As he pointed out, the range of the function can be specified in the fit command. In the above data set, the linear region starts from x=2.63. set term svg set output 'blue.svg' set term svg set output 'blue.svg' f(x) = a*x + b fit[2.63:] f(x) '07-B.txt' via a,b plot[][-1:3] '07-B.txt' pt 7, f(...

Only top voted, non community-wiki answers of a minimum length are eligible