Files
x07mb/script/test/ScanPlot.py
2022-03-04 14:28:28 +01:00

24 lines
629 B
Python

from mathutils import *
from plotutils import *
y = [0,1,2,3,5,15, 60, 17, 14,6,3,2] #ret.getReadable(0)
x = [0,1,2,3,4,5,6,7,8,9,10,11] #ret.getPositions(0)
p = plot(y, xdata=x, title="Processed")[0]
#function = interpolate(y,x,"cubic")
d = deriv(y,x)
plot_function(p, interpolate(d,x,"cubic"), "Deriv", x)
p.setLegendVisible(True)
(normalization, mean_val, sigma) = fit_gaussian(y, x)
fitted_gaussian_function = Gaussian(normalization, mean_val, sigma)
plot_function(p, fitted_gaussian_function, "Fit", x)
p.addText(x[5], max(y)+2, get_exec_pars().path, Color.RED)
plots = get_plot_snapshots("Processed")
print plots